Skip to content

Instantly share code, notes, and snippets.

@idcrook
Created June 13, 2018 15:06
Show Gist options
  • Save idcrook/28fd6059894cc4f03e74fc48b44da719 to your computer and use it in GitHub Desktop.
Save idcrook/28fd6059894cc4f03e74fc48b44da719 to your computer and use it in GitHub Desktop.
emacs neotree and projectile: sync with projectile
;; 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)
@larrasket
Copy link

Thanks

@sathishmanohar
Copy link

Perfect! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment