ui/treemacs: refactor & activate treemacs-git-mode
This commit is contained in:
parent
f426623e4b
commit
4c0751ca75
1 changed files with 38 additions and 9 deletions
|
@ -1,19 +1,48 @@
|
||||||
;;; ui/treemacs/config.el -*- lexical-binding: t; -*-
|
;;; ui/treemacs/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(setq treemacs-follow-after-init t
|
(defvar +treemacs-git-mode 'simple
|
||||||
treemacs-is-never-other-window t
|
"Type of git integration for `treemacs-git-mode'.
|
||||||
treemacs-sorting 'alphabetic-case-insensitive-asc
|
|
||||||
treemacs-persist-file (concat doom-cache-dir "treemacs-persist")
|
There are 3 possible values:
|
||||||
treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist"))
|
|
||||||
|
1) `simple', which highlights only files based on their git status, and is
|
||||||
|
slightly faster,
|
||||||
|
2) `extended', which highlights both files and directories, but requires
|
||||||
|
python,
|
||||||
|
3) `deferred', same as extended, but highlights asynchronously.
|
||||||
|
|
||||||
|
This must be set before `treemacs' has loaded.")
|
||||||
|
|
||||||
|
|
||||||
(after! treemacs
|
;;
|
||||||
|
;;; Packages
|
||||||
|
|
||||||
|
(use-package! treemacs
|
||||||
|
:defer t
|
||||||
|
:init
|
||||||
|
(setq treemacs-follow-after-init t
|
||||||
|
treemacs-is-never-other-window t
|
||||||
|
treemacs-sorting 'alphabetic-case-insensitive-asc
|
||||||
|
treemacs-persist-file (concat doom-cache-dir "treemacs-persist")
|
||||||
|
treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist"))
|
||||||
|
:config
|
||||||
|
;; Allow ace-window to target treemacs windows
|
||||||
|
(after! ace-window
|
||||||
|
(delq! 'treemacs-mode aw-ignored-buffers))
|
||||||
|
|
||||||
;; Don't follow the cursor
|
;; Don't follow the cursor
|
||||||
(treemacs-follow-mode -1)
|
(treemacs-follow-mode -1)
|
||||||
|
|
||||||
;; Allow ace-window to target treemacs windows
|
(when +treemacs-git-mode
|
||||||
(after! ace-window
|
;; If they aren't supported, fall back to simpler methods
|
||||||
(delq! 'treemacs-mode aw-ignored-buffers)))
|
(when (and (memq +treemacs-git-mode '(deferred extended))
|
||||||
|
(not (executable-find "python3")))
|
||||||
|
(setq +treemacs-git-mode 'simple))
|
||||||
|
(treemacs-git-mode +treemacs-git-mode)
|
||||||
|
(setq treemacs-collapse-dirs
|
||||||
|
(if (memq treemacs-git-mode '(extended deferred))
|
||||||
|
3
|
||||||
|
0))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! treemacs-evil
|
(use-package! treemacs-evil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue