From e1441fd66356fb8d173f7de41f49620b5260108d Mon Sep 17 00:00:00 2001 From: luxick Date: Tue, 15 Oct 2019 10:57:08 +0200 Subject: [PATCH] Add treemacs package. --- setup-emacs.org | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/setup-emacs.org b/setup-emacs.org index 9749d32..195d6cd 100644 --- a/setup-emacs.org +++ b/setup-emacs.org @@ -517,6 +517,82 @@ This is my configuration for the emacs editor. "| %? | |"))) #+END_SRC +* Treemacs + Treemacs makes navigating folders and files much easier. This is the default config from [[https://github.com/Alexander-Miller/treemacs][the offical repository]] as a base, with slight modifications to suite my config. + + #+BEGIN_SRC emacs-lisp + (use-package treemacs + :defer t + :init + (with-eval-after-load 'winum + (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) + :config + (progn + (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) + treemacs-deferred-git-apply-delay 0.5 + treemacs-display-in-side-window t + treemacs-eldoc-display t + treemacs-file-event-delay 5000 + treemacs-file-follow-delay 0.2 + treemacs-follow-after-init t + treemacs-git-command-pipe "" + treemacs-goto-tag-strategy 'refetch-index + treemacs-indentation 2 + treemacs-indentation-string " " + treemacs-is-never-other-window nil + treemacs-max-git-entries 5000 + treemacs-missing-project-action 'ask + treemacs-no-png-images nil + treemacs-no-delete-other-windows t + treemacs-project-follow-cleanup nil + treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) + treemacs-position 'left + treemacs-recenter-distance 0.1 + treemacs-recenter-after-file-follow nil + treemacs-recenter-after-tag-follow nil + treemacs-recenter-after-project-jump 'always + treemacs-recenter-after-project-expand 'on-distance + treemacs-show-cursor nil + treemacs-show-hidden-files t + treemacs-silent-filewatch nil + treemacs-silent-refresh nil + treemacs-sorting 'alphabetic-desc + treemacs-space-between-root-nodes t + treemacs-tag-follow-cleanup t + treemacs-tag-follow-delay 1.5 + treemacs-width 35) + + ;; The default width and height of the icons is 22 pixels. If you are + ;; using a Hi-DPI display, uncomment this to double the icon size. + ;;(treemacs-resize-icons 44) + + (treemacs-follow-mode t) + (treemacs-filewatch-mode t) + (treemacs-fringe-indicator-mode t) + (pcase (cons (not (null (executable-find "git"))) + (not (null treemacs-python-executable))) + (`(t . t) + (treemacs-git-mode 'deferred)) + (`(t . _) + (treemacs-git-mode 'simple)))) + :bind + (:map global-map + ("M-0" . treemacs-select-window) + ("C-x t 1" . treemacs-delete-other-windows) + ("C-x t t" . treemacs) + ("C-x t B" . treemacs-bookmark) + ("C-x t C-t" . treemacs-find-file) + ("C-x t M-t" . treemacs-find-tag))) + + (use-package treemacs-icons-dired + :after treemacs dired + :ensure t + :config (treemacs-icons-dired-mode)) + + (use-package treemacs-magit + :after treemacs magit + :ensure t) + #+END_SRC * Additional Package Imports ** All The Icons We want to have some nice looking icons