From 35a86b042bbdb6ad0d78765d80c8b35c53b70421 Mon Sep 17 00:00:00 2001 From: mattkae Date: Fri, 14 Oct 2022 09:13:29 -0400 Subject: Reloading neotree when we create a file/directory --- lisp/general.el | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'lisp/general.el') 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 -- cgit v1.2.1