tools/neotree: +neotree/toggle => +neotree-open; add +neotree/find-this-file

This commit is contained in:
Henrik Lissner 2018-02-11 04:36:52 -05:00
parent 4566dea4b3
commit a37449d4e4
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 19 additions and 3 deletions

View file

@ -1,8 +1,23 @@
;;; tools/neotree/autoload.el -*- lexical-binding: t; -*-
;; `neotree-show' and `neotree-find' don't respect the current project, and open
;; neotree in `default-directory'. `+neotree/open' and `neotree/find-this-file'
;; will ensure the neotree pane is always rooted in the project root.
;;;###autoload
(defun +neotree/toggle ()
"Toggle the neotree window."
(defun +neotree/open ()
"Open the neotree window in the current project."
(interactive)
(let ((path buffer-file-name)
(project-root (doom-project-root 'nocache)))
(require 'neotree)
(if (neo-global--window-exists-p)
(neotree-hide)
(neotree-dir project-root))))
;;;###autoload
(defun +neotree/find-this-file ()
"Open the neotree window in the current project, and find the current file."
(interactive)
(let ((path buffer-file-name)
(project-root (doom-project-root 'nocache)))