-
Notifications
You must be signed in to change notification settings - Fork 0
/
40_neotree.el
51 lines (45 loc) · 1.43 KB
/
40_neotree.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;;; 40_neotree.el --- Neotree configurations. -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;; (setq debug-on-error t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Neotree configurations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(leaf neotree
:ensure t
:bind (("<f10>" . neotree-find)
(:neotree-mode-map
("RET" . neotree-enter-hide)
("a" . neotree-hidden-file-toggle)
("<left>" . neotree-select-up-node)
("<right>" . neotree-change-root)
("<f10>" . neotree-toggle)))
:custom
`((neo-keymap-style . 'concise)
(neo-create-file-auto-open . t)))
;; Change neotree's font size
;; Tips from https://github.com/jaypei/emacs-neotree/issues/218
(defun neotree-text-scale ()
"Neotree text scale."
(interactive)
(text-scale-adjust 0)
(text-scale-decrease 0.8)
(message nil))
(add-hook 'neo-after-create-hook
(lambda (_)
(call-interactively 'neotree-text-scale)))
;; neotree enter hide
;; Tips from https://github.com/jaypei/emacs-neotree/issues/77
(defun neo-open-file-hide (full-path &optional arg)
"Neotree enter hide with FULL-PATH ARG."
(neo-global--select-mru-window arg)
(find-file full-path)
(neotree-hide))
(defun neotree-enter-hide (&optional arg)
"Neotree enter hide with ARG."
(interactive "P")
(neo-buffer--execute arg 'neo-open-file-hide 'neo-open-dir))
;; Local Variables:
;; no-byte-compile: t
;; End:
;;; 40_neotree.el ends here