ui/treemacs: refactor
Treemacs enables treemacs-filewatch-mode and treemacs-git-mode itself. Also removes settings that are the same as the defaults.
This commit is contained in:
parent
12ddc3c360
commit
0534d85c54
1 changed files with 7 additions and 26 deletions
|
@ -1,19 +1,16 @@
|
|||
;;; ui/treemacs/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(setq treemacs-follow-after-init t
|
||||
treemacs-width 35
|
||||
treemacs-position 'left
|
||||
treemacs-is-never-other-window t
|
||||
treemacs-silent-refresh nil
|
||||
treemacs-indentation 2
|
||||
treemacs-sorting 'alphabetic-desc
|
||||
treemacs-show-hidden-files t
|
||||
treemacs-goto-tag-strategy 'refetch-index
|
||||
treemacs-display-in-side-window t
|
||||
treemacs-sorting 'alphabetic-case-insensitive-desc
|
||||
treemacs-persist-file (concat doom-cache-dir "treemacs-persist"))
|
||||
|
||||
(after! treemacs-persistence
|
||||
(setq treemacs--last-error-persist-file (concat doom-cache-dir "treemacs-persist-at-last-error")))
|
||||
;; This variable is defined with defconst, so we must wait to change it until
|
||||
;; it has loaded.
|
||||
(setq treemacs--last-error-persist-file
|
||||
(concat doom-cache-dir
|
||||
"treemacs-persist-at-last-error")))
|
||||
|
||||
|
||||
(after! treemacs
|
||||
|
@ -23,29 +20,13 @@
|
|||
:quit nil
|
||||
:ttl 0)
|
||||
|
||||
(defvar +treemacs-use-git-mode
|
||||
(pcase (cons (not (null (executable-find "git")))
|
||||
(not (null (executable-find "python3"))))
|
||||
(`(t . t) 'extended)
|
||||
(`(t) 'simple))
|
||||
"Type of git integration for `treemacs-git-mode'.
|
||||
There are 2 possible values:
|
||||
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")
|
||||
|
||||
(defvar treemacs-collapse-dirs
|
||||
(if (executable-find "python3") 3 0))
|
||||
|
||||
(defun +treemacs|improve-hl-line-contrast ()
|
||||
"`hl-line' doesn't stand out enough in some themes."
|
||||
(face-remap-add-relative 'hl-line 'region))
|
||||
(add-hook 'treemacs-mode-hook #'+treemacs|improve-hl-line-contrast)
|
||||
|
||||
;; Don't follow the cursor
|
||||
(treemacs-follow-mode -1)
|
||||
(treemacs-filewatch-mode t)
|
||||
(when (memq +treemacs-use-git-mode '(simple extended))
|
||||
(treemacs-git-mode +treemacs-use-git-mode))
|
||||
|
||||
(after! ace-window
|
||||
(setq aw-ignored-buffers (delq 'treemacs-mode aw-ignored-buffers))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue