diff options
| author | bh <qn+git@excalibur.computer> | 2025-12-12 16:31:16 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2025-12-12 16:31:16 +0800 |
| commit | f5e40c74da77adf875dea03c0a120ea64d7a58d4 (patch) | |
| tree | 76f0bcc5be4f74b159fdb7ca618bb8778b18c69b | |
| parent | c85fe0eeee044478126584582adbe7e4322de8a6 (diff) | |
Added Treemacs
| -rw-r--r-- | config/modeline.el | 6 | ||||
| -rw-r--r-- | config/treemacs.el | 46 |
2 files changed, 52 insertions, 0 deletions
diff --git a/config/modeline.el b/config/modeline.el index 20d94d4..b6941ef 100644 --- a/config/modeline.el +++ b/config/modeline.el @@ -4,6 +4,12 @@ ;;(use-package nerd-icons) (use-package nerd-icons :config + ;; Fix missing data symlink (straight.el doesn't create it automatically) + (let ((data-link (expand-file-name "straight/build/nerd-icons/data" user-emacs-directory)) + (data-source (expand-file-name "straight/repos/nerd-icons/data" user-emacs-directory))) + (unless (file-exists-p data-link) + (when (file-exists-p data-source) + (make-symbolic-link data-source data-link)))) ;; Prevent icons from becoming bold in active modeline (dolist (face (face-list)) (when (string-prefix-p "nerd-icons-" (symbol-name face)) diff --git a/config/treemacs.el b/config/treemacs.el new file mode 100644 index 0000000..07ecb41 --- /dev/null +++ b/config/treemacs.el @@ -0,0 +1,46 @@ +;; Treemacs - Simple Configuration + +(use-package treemacs + :defer t + :config + (setq treemacs-width 35 + treemacs-width-is-initially-locked nil ;; Allow resizing + treemacs-width-increment 1 ;; Smooth resize + treemacs-position 'left + treemacs-show-hidden-files t + ; treemacs-indentation 1 ;; Minimal indentation + ; treemacs-indentation-string " " ;; Just space, no lines + + ;; Disable mouse Features + treemacs-move-files-by-mouse-dragging nil ;; NO DRAGGING FILES! + treemacs-recenter-after-file-follow nil ;; Prevent mouse issues + treemacs-silent-filewatch t ;; Reduce mouse events + treemacs-show-cursor nil) ;; Hide cursor in treemacs + + ;; Disable mouse in treemacs completely + :hook + (treemacs-mode . (lambda () + ;; Disable all mouse button bindings + (define-key treemacs-mode-map [mouse-1] 'ignore) + (define-key treemacs-mode-map [mouse-2] 'ignore) + (define-key treemacs-mode-map [mouse-3] 'ignore) + (define-key treemacs-mode-map [drag-mouse-1] 'ignore) + (define-key treemacs-mode-map [down-mouse-1] 'ignore) + (define-key treemacs-mode-map [double-mouse-1] 'ignore) + (define-key treemacs-mode-map [triple-mouse-1] 'ignore))) + :bind + ("C-x t t" . treemacs)) + +;; Beautiful icons for treemacs using nerd-icons +(use-package treemacs-nerd-icons + :after treemacs + :config + ;; Reduce spacing between arrows and icons + (setq treemacs-nerd-icons-tab (propertize " " :face 'treemacs-nerd-icons-file-face)) + (treemacs-load-theme "nerd-icons")) + +;; Customize folder icon colors (for nerd-icons theme) +(with-eval-after-load 'treemacs-nerd-icons + (set-face-attribute 'treemacs-nerd-icons-file-face nil + :foreground "#74c4c4" + :inherit 'unspecified)) |
