Created
June 13, 2018 15:06
-
-
Save idcrook/28fd6059894cc4f03e74fc48b44da719 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
Thanks