diff options
author | mattkae <mattkae@protonmail.com> | 2022-10-14 09:13:29 -0400 |
---|---|---|
committer | mattkae <mattkae@protonmail.com> | 2022-10-14 09:13:29 -0400 |
commit | 35a86b042bbdb6ad0d78765d80c8b35c53b70421 (patch) | |
tree | 684db56de0f4b518dd2dc8b85ef574fc21a26e06 | |
parent | 4b547482a9102b0b42432d11d7995d75c02a51f7 (diff) |
Reloading neotree when we create a file/directory
-rw-r--r-- | lisp/general.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/general.el b/lisp/general.el index 21abf07..5945db0 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -68,8 +68,6 @@ (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) -(add-hook 'after-save-hook 'neotree-refresh) - ;; Smooth scroll (setq redisplay-dont-pause t scroll-margin 7 @@ -101,8 +99,19 @@ (bind-key* (kbd "C-x C-f") 'counsel-find-file) (bind-key* (kbd "M-x") 'counsel-M-x) (bind-key* (kbd "C-;") 'neotree-toggle) -(bind-key* (kbd "s-N") 'make-empty-file) -(bind-key* (kbd "s-D") 'make-directory) + +(defun create-file () + (interactive) + (call-interactively #'make-empty-file) + (neotree-refresh)) + +(bind-key* (kbd "s-n") 'create-file) + +(defun create-directory () + (interactive) + (call-interactively #'make-directory) + (neotree-refresh)) +(bind-key* (kbd "s-N") 'create-directory) ;; Company mode for code completion (use-package company |