neotree: unicode icon display; wider window

This commit is contained in:
Henrik Lissner 2016-05-20 17:22:52 -04:00
parent 6ac3e495bd
commit 99b5d42f3f
2 changed files with 17 additions and 13 deletions

View file

@ -85,15 +85,17 @@
neo-auto-indent-point t neo-auto-indent-point t
neo-mode-line-type 'none neo-mode-line-type 'none
neo-persist-show nil neo-persist-show nil
neo-window-width 26 neo-window-width 28
neo-show-updir-line nil neo-show-updir-line nil
neo-auto-indent-point t neo-auto-indent-point t
neo-theme 'nerd ; fallback
neo-banner-message nil) neo-banner-message nil)
:config :config
(evil-set-initial-state 'neotree-mode 'motion) (evil-set-initial-state 'neotree-mode 'motion)
(add-hook 'neo-after-create-hook 'narf|hide-mode-line)
;; A custom and simple theme for neotree ;; A custom and simple theme for neotree
(advice-add 'neo-buffer--insert-fold-symbol :override 'narf*neo-buffer-fold-symbol) (advice-add 'neo-buffer--insert-fold-symbol :override 'narf*neo-theme)
;; Shorter pwd in neotree ;; Shorter pwd in neotree
(advice-add 'neo-buffer--insert-root-entry :filter-args 'narf*neotree-shorten-pwd) (advice-add 'neo-buffer--insert-root-entry :filter-args 'narf*neotree-shorten-pwd)
;; Don't ask for confirmation when creating files ;; Don't ask for confirmation when creating files
@ -103,7 +105,9 @@
(add-hook 'neotree-mode-hook 'narf|neotree-init-keymap) (add-hook 'neotree-mode-hook 'narf|neotree-init-keymap)
(defun narf|neotree-init-keymap () (defun narf|neotree-init-keymap ()
(setq line-spacing 1)
(map! :map evil-motion-state-local-map (map! :map evil-motion-state-local-map
"ESC ESC" 'neotree-hide
"q" 'neotree-hide "q" 'neotree-hide
"RET" 'neotree-enter "RET" 'neotree-enter
"J" 'neotree-select-next-sibling-node "J" 'neotree-select-next-sibling-node

View file

@ -33,16 +33,6 @@
(eq (current-buffer) (neo-global--get-buffer))) (eq (current-buffer) (neo-global--get-buffer)))
(neotree-hide))) (neotree-hide)))
;;;###autoload
(defun narf*neo-buffer-fold-symbol (name)
"Custom hybrid ascii theme with leading whitespace."
(let ((n-insert-symbol (lambda (n)
(neo-buffer--insert-with-face
n 'neo-expand-btn-face))))
(or (and (eq name 'open) (funcall n-insert-symbol "- "))
(and (eq name 'close) (funcall n-insert-symbol "+ "))
(and (eq name 'leaf) (funcall n-insert-symbol " ")))))
;;;###autoload ;;;###autoload
(defun narf*save-neotree (orig-fun &rest args) (defun narf*save-neotree (orig-fun &rest args)
"Prevents messing up the neotree buffer on window changes" "Prevents messing up the neotree buffer on window changes"
@ -57,7 +47,17 @@
;;;###autoload ;;;###autoload
(defun narf*neotree-shorten-pwd (node) (defun narf*neotree-shorten-pwd (node)
"Shorter pwd in neotree" "Shorter pwd in neotree"
(list (abbreviate-file-name (car node)))) (list (concat "" (projectile-project-name))))
;;;###autoload
(defun narf*neo-theme (name)
"Custom hybrid ascii theme with leading whitespace."
(let ((n-insert-symbol (lambda (n)
(neo-buffer--insert-with-face
n 'neo-expand-btn-face))))
(or (and (eq name 'open) (funcall n-insert-symbol " -  "))
(and (eq name 'close) (funcall n-insert-symbol " +  "))
(and (eq name 'leaf) (funcall n-insert-symbol " ")))))
(provide 'defuns-neotree) (provide 'defuns-neotree)
;;; defuns-neotree.el ends here ;;; defuns-neotree.el ends here