Files
.emacs.d/lisp/init-treemacs.el

61 lines
1.9 KiB
EmacsLisp
Raw Permalink Normal View History

2025-12-20 15:13:13 +11:00
;; -*- lexical-binding: t; -*-
(use-package treemacs
:custom-face
(cfrs-border-color ((t (:inherit posframe-border))))
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
:config
(pcase (cons (not (null (executable-find "git")))
(not (null (executable-find "python3"))))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple)))
2025-12-21 02:52:39 +11:00
2025-12-20 15:13:13 +11:00
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
treemacs-missing-project-action 'remove
treemacs-user-mode-line-format 'none
treemacs-sorting 'alphabetic-asc
2026-04-02 19:21:30 +11:00
treemacs-follow-elpaca-after-init t
2025-12-20 15:13:13 +11:00
treemacs-width 30
2025-12-21 12:54:49 +11:00
treemacs-show-hidden-files nil
treemacs-silent-refresh t
treemacs-no-png-images 1)
2025-12-20 15:13:13 +11:00
:bind
(:map global-map
("M-0" . treemacs-select-window)
("C-x t 1" . treemacs-delete-other-windows)
("C-c o p" . treemacs)
("C-x t d" . treemacs-select-directory)
("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-magit
:hook ((magit-post-commit
git-commit-post-finish
magit-post-stage
magit-post-unstage)
. treemacs-magit--schedule-update))
(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
:after (treemacs)
2026-04-02 19:21:30 +11:00
:ensure t
2025-12-20 15:13:13 +11:00
:config (treemacs-set-scope-type 'Tabs))
(use-package treemacs-nerd-icons
:demand t
:config (treemacs-nerd-icons-config))
2025-12-21 04:35:19 +11:00
(use-package treemacs-persp
2025-12-21 12:54:49 +11:00
:after (treemacs persp-mode)
2025-12-21 04:35:19 +11:00
:demand t
:functions treemacs-set-scope-type
:config (treemacs-set-scope-type 'Perspectives))
2025-12-21 12:54:49 +11:00
(use-package treemacs-projectile
:after (treemacs projectile-mode))
2025-12-20 15:13:13 +11:00
(provide 'init-treemacs)