2018-06-09 12:16:29 +10:00
|
|
|
;;; ui/treemacs/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2018-07-10 23:05:01 +02:00
|
|
|
(setq treemacs-follow-after-init t
|
2018-06-10 23:16:50 +02:00
|
|
|
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
|
2018-06-14 14:01:25 +02:00
|
|
|
treemacs-goto-tag-strategy 'refetch-index
|
|
|
|
;; for `treemacs-persistence'
|
|
|
|
treemacs-persist-file (concat doom-cache-dir "treemacs-persist"))
|
2018-06-10 23:16:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
(after! treemacs
|
|
|
|
(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'.
|
2018-06-09 12:16:29 +10:00
|
|
|
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")
|
|
|
|
|
2018-06-10 23:16:50 +02:00
|
|
|
(defvar treemacs-collapse-dirs
|
|
|
|
(if (executable-find "python3") 3 0))
|
|
|
|
|
2018-07-19 03:38:52 +02:00
|
|
|
(treemacs-follow-mode -1)
|
2018-06-09 12:16:29 +10:00
|
|
|
(treemacs-filewatch-mode t)
|
2018-06-10 23:16:50 +02:00
|
|
|
(when (memq +treemacs-use-git-mode '(simple extended))
|
2018-07-10 23:06:26 +02:00
|
|
|
(treemacs-git-mode +treemacs-use-git-mode)))
|
2018-06-09 12:16:29 +10:00
|
|
|
|
|
|
|
|
|
|
|
(def-package! treemacs-evil
|
2018-06-10 23:16:50 +02:00
|
|
|
:when (featurep! :feature evil +everywhere)
|
2018-06-11 00:11:20 +02:00
|
|
|
:after treemacs
|
|
|
|
:config (define-key evil-treemacs-state-map [escape] #'delete-window))
|
2018-06-10 23:16:50 +02:00
|
|
|
|
2018-06-09 12:16:29 +10:00
|
|
|
|
|
|
|
(def-package! treemacs-projectile
|
2018-06-10 23:16:50 +02:00
|
|
|
:after treemacs)
|