-
-
Save sathishmanohar/6db14b6e5bfb3dd1ebe42731b735986c to your computer and use it in GitHub Desktop.
emacs neotree and projectile: sync with projectile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; NeoTree can be opened (toggled) at projectile project root | |
(defun neotree-project-dir () | |
"Open NeoTree using the git root." | |
(interactive) | |
(let ((project-dir (projectile-project-root)) | |
(file-name (buffer-file-name))) | |
(neotree-toggle) | |
(if project-dir | |
(if (neo-global--window-exists-p) | |
(progn | |
(neotree-dir project-dir) | |
(neotree-find file-name))) | |
(message "Could not find git project root.")))) | |
;; need another one for python stuff, since this gets re-bound | |
(global-set-key (kbd "C-c C-p") 'neotree-project-dir) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment