Set up treemacs

This commit is contained in:
Jeremy Dormitzer 2019-11-13 22:18:29 -05:00
parent f7349ef34b
commit 6a1cf6c01b

View File

@ -767,13 +767,13 @@ Olivetti is a minor mode for a nice writing environment.
* Winum
This package includes functions to switch windows by number.
#+BEGIN_SRC emacs-lisp
(defun winum-assign-0-to-neotree ()
(when (string-match-p (buffer-name) ".*\\NeoTree\\*.*") 10))
(defun winum-assign-0-to-treemacs ()
(when (string-match-p "Treemacs" (buffer-name)) 10))
(use-package winum
:config
(winum-mode)
(add-to-list 'winum-assign-functions #'winum-assign-0-to-neotree)
(add-to-list 'winum-assign-functions #'winum-assign-0-to-treemacs)
(leader-def-key "0" 'winum-select-window-0-or-10)
(leader-def-key "1" 'winum-select-window-1)
(leader-def-key "2" 'winum-select-window-2)
@ -831,6 +831,36 @@ And while we're here let's enable all-the-icons for dired as well:
(add-hook 'dired-mode-hook #'all-the-icons-dired-mode))
#+END_SRC
* Treemacs
An alternative to NeoTree with fancy functionality:
#+BEGIN_SRC emacs-lisp
(defun treemacs-ignore-pyc (name path)
(string-match-p ".*\\.pyc$" name))
(use-package treemacs
:config
(treemacs-follow-mode t)
(add-to-list 'treemacs-ignored-file-predicates #'treemacs-ignore-pyc)
(setq treemacs-project-follow-cleanup t
treemacs-tag-follow-delay 0.5)
(with-eval-after-load 'treemacs-compatibility
(with-eval-after-load 'winum
(delete
(regexp-quote
(format "%sFramebuffer-" treemacs--buffer-name-prefix))
winum-ignored-buffers-regexp))))
(use-package treemacs-evil
:after (treemacs evil))
(use-package treemacs-projectile
:after (treemacs projectile))
(use-package treemacs-magit
:after (treemacs magit))
(leader-def-key "d" #'treemacs)
#+END_SRC
* Backups and Autosaves
Store backups and autosaves in a centralized place. This should really be the default...
#+BEGIN_SRC emacs-lisp
@ -3505,6 +3535,8 @@ Get a nice IMenu sidebar:
(imenu-list-major-mode-map "SPC" leader-map)
(imenu-list-major-mode-map "." #'imenu-list-display-entry))
(setq imenu-auto-rescan t)
(leader-def-key "\\" #'imenu-list-smart-toggle)
(leader-def-key "m" #'imenu)
#+END_SRC