all repos — nixfiles @ f704a8db2409787d97086d76dc7fb3430b80cd22

System and user configuration, managed by nix and home-manager

emacs: try treemacs
Alan Pearce alan@alanpearce.eu
Tue, 21 May 2024 18:40:41 +0200
commit

f704a8db2409787d97086d76dc7fb3430b80cd22

parent

d26176849ff400ea3752d6b4da2437b8f6d6bb40

2 files changed, 40 insertions(+), 0 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -947,6 +947,32 @@ (evil-ex-define-cmd "pesh[ell]" #'project-eshell)               (evil-ex-define-cmd "pb" #'project-switch-to-buffer)
               (evil-ex-define-cmd "psw[itch]" #'project-switch-project))))
 
+(use-package treemacs
+  :general (:keymaps 'treemacs-mode-map
+                     [mouse-1] #'treemacs-single-click-expand-action)
+  :config (progn
+            (treemacs-project-follow-mode t)
+            (setq treemacs-is-never-other-window t
+                  treemacs-select-when-already-in-treemacs 'move-back
+                  treemacs-eldoc-display nil
+                  treemacs-indentation '(8 px)
+                  treemacs-show-hidden-files nil
+                  treemacs-recenter-after-project-jump 'on-distance
+                  treemacs-missing-project-action 'remove)))
+
+(use-package treemacs-evil
+  :after treemacs)
+
+(use-package treemacs-magit
+  :after treemacs)
+
+(use-package treemacs-nerd-icons
+  :after treemacs
+  :init (progn
+          (setq treemacs-nerd-icons-tab " "))
+  :config (progn
+            (treemacs-load-theme "simple")))
+
 (use-package consult-ghq
   :defer 5
   :general (:keymaps 'project-prefix-map
@@ -1215,6 +1241,7 @@ "q" #'evil-delete-buffer   "p" '(:keymap project-prefix-map :package project)
   "v" #'split-window-right
   "o" #'other-window
+  "s" #'treemacs-select-window
   "u" #'universal-argument
   ";" #'execute-extended-command
   "bb" #'consult-buffer
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -151,6 +151,10 @@ systemd         tempel
         tempel-collection
         eglot-tempel
+        treemacs
+        treemacs-evil
+        treemacs-magit
+        treemacs-nerd-icons
         treesit-grammars.with-all-grammars
         treesit-auto
         vc-msg
@@ -177,6 +181,15 @@ repo = "just-mode.el";           rev = "08eb25e0641b4b6d79aa39182c70b9d40c56fc02";
           sha256 = "13ccphbd95bn79pqbw6ycnfy1z8yd32swrhd1ljl7gwbhi7q6s0p";
           # date = "2024-05-01T22:22:02+02:00";
+        };
+      });
+      treemacs-nerd-icons = self.melpaPackages.treemacs-nerd-icons.overrideAttrs (old: {
+        src = pkgs.fetchFromGitHub {
+          owner = "aaronmiller";
+          repo = "treemacs-nerd-icons";
+          sha256 = "171pdi5y9zym26iqi02c5p7zw9i7xxhv4csnjb7qlkkczha17jgp";
+          rev = "90b4f0868eea1ea923dee97d2c5457c21a61f37a";
+          # date = "2023-11-02T13:42:55-04:00";
         };
       });
       lsp-mode = self.melpaPackages.lsp-mode.overrideAttrs {