treemacs: adapt config to new treemacs-git-mode feature.

This commit is contained in:
Alexander Miller 2017-12-18 08:15:55 +01:00 committed by syl20bnr
parent da1331870a
commit a23ab04926
2 changed files with 18 additions and 2 deletions

View File

@ -18,3 +18,14 @@
(defvar treemacs-use-collapsed-directories (if (executable-find "python") 3 0)
"Number of directories to collapse with `treemacs-collapse-dirs'.
Must be a number.")
(defvar treemacs-use-git-mode
(pcase (cons (not (null (executable-find "git")))
(not (null (executable-find "python"))))
(`(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")

View File

@ -41,7 +41,6 @@
treemacs-is-never-other-window nil
treemacs-silent-refresh nil
treemacs-indentation 2
treemacs-git-integration t
treemacs-change-root-without-asking nil
treemacs-sorting 'alphabetic-desc
treemacs-show-hidden-files t
@ -53,7 +52,13 @@
(treemacs-follow-mode t))
(when treemacs-use-filewatch-mode
(treemacs-filewatch-mode t)))))
(treemacs-filewatch-mode t))
;; this boundp check guards against a new feature that not all treemacs installations will have
;; TODO remove this guard in a few weeks
(when (boundp 'treemacs-git-mode)
(when (memq treemacs-use-git-mode '(simple extended))
(treemacs-git-mode treemacs-use-git-mode))))))
(defun treemacs/init-treemacs-evil ()
(use-package treemacs-evil