summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--user/emacs/init.el27
-rw-r--r--user/settings/emacs.nix13
2 files changed, 40 insertions, 0 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 7cdfa370..6652d57c 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -947,6 +947,32 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
               (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 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
   "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
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 2b8311ed..5ed9eb4f 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -151,6 +151,10 @@ in
         tempel
         tempel-collection
         eglot-tempel
+        treemacs
+        treemacs-evil
+        treemacs-magit
+        treemacs-nerd-icons
         treesit-grammars.with-all-grammars
         treesit-auto
         vc-msg
@@ -179,6 +183,15 @@ in
           # 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 {
         LSP_USE_PLISTS = "true"; # must be set in early-init
       };