1
0
Fork 0

fix(emacs): reasonable behaviour for neotree in dired buffers

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2024-02-05 15:59:28 -05:00
parent 6bd95ffd8e
commit 81c3106161
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47

View file

@ -111,9 +111,9 @@
"Toggle neotree at the current directory." "Toggle neotree at the current directory."
(interactive) (interactive)
(let ((current-directory (let ((current-directory
(if buffer-file-name (or (and buffer-file-name (file-name-directory buffer-file-name))
(file-name-directory buffer-file-name) (and (eq major-mode 'dired-mode) (dired-current-directory))
"~"))) "~")))
(if (and (fboundp 'neo-global--window-exists-p) (if (and (fboundp 'neo-global--window-exists-p)
(neo-global--window-exists-p)) (neo-global--window-exists-p))
(neotree-hide) (neotree-hide)
@ -122,6 +122,7 @@
(keymap-global-set "C-c t" #'neotree-toggle-current-directory) (keymap-global-set "C-c t" #'neotree-toggle-current-directory)
(setq neo-theme 'icons) (setq neo-theme 'icons)
(setq neo-smart-open t) (setq neo-smart-open t)
(setq neo-window-fixed-size nil)
(add-hook 'neotree-mode-hook (lambda () (text-scale-set -0.5))) (add-hook 'neotree-mode-hook (lambda () (text-scale-set -0.5)))
;; Orderless ;; Orderless