2017-08-07 06:37:47 +00:00
|
|
|
;;; packages.el --- treemacs Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2017-08-07 06:37:47 +00:00
|
|
|
;;
|
|
|
|
;; Author: Alexander Miller <alexanderm@web.de>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(defconst treemacs-packages
|
2017-10-08 16:01:48 +00:00
|
|
|
'(golden-ratio
|
|
|
|
treemacs
|
2017-08-07 06:37:47 +00:00
|
|
|
(treemacs-evil :toggle (memq dotspacemacs-editing-style '(vim hybrid)))
|
2017-10-08 16:01:48 +00:00
|
|
|
treemacs-projectile
|
2017-08-07 06:37:47 +00:00
|
|
|
winum))
|
|
|
|
|
|
|
|
(defun treemacs/pre-init-golden-ratio ()
|
|
|
|
(spacemacs|use-package-add-hook golden-ratio
|
|
|
|
:post-config
|
2017-10-08 16:05:43 +00:00
|
|
|
(add-to-list 'golden-ratio-exclude-buffer-regexp
|
|
|
|
(rx "*Treemacs" (0+ any)))))
|
2017-08-07 06:37:47 +00:00
|
|
|
|
|
|
|
(defun treemacs/init-treemacs ()
|
|
|
|
(use-package treemacs
|
2017-10-08 16:03:21 +00:00
|
|
|
:commands treemacs--window-number-ten
|
2017-08-07 06:37:47 +00:00
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"ft" #'treemacs-toggle
|
|
|
|
"fT" #'treemacs
|
|
|
|
"fB" #'treemacs-bookmark
|
|
|
|
"f C-t" #'treemacs-find-file)
|
|
|
|
:config
|
|
|
|
(progn
|
2017-11-25 19:13:59 +00:00
|
|
|
(spacemacs/define-evil-state-face "treemacs" "MediumPurple1")
|
2017-10-08 16:05:43 +00:00
|
|
|
(setq treemacs-follow-after-init t
|
|
|
|
treemacs-width 35
|
|
|
|
treemacs-position 'left
|
|
|
|
treemacs-is-never-other-window nil
|
|
|
|
treemacs-silent-refresh nil
|
|
|
|
treemacs-indentation 2
|
2017-08-07 06:37:47 +00:00
|
|
|
treemacs-change-root-without-asking nil
|
2017-10-08 16:05:43 +00:00
|
|
|
treemacs-sorting 'alphabetic-desc
|
|
|
|
treemacs-show-hidden-files t
|
|
|
|
treemacs-never-persist nil
|
|
|
|
treemacs-goto-tag-strategy 'refetch-index
|
|
|
|
treemacs-collapse-dirs treemacs-use-collapsed-directories)
|
2017-08-07 06:37:47 +00:00
|
|
|
|
|
|
|
(when treemacs-use-follow-mode
|
|
|
|
(treemacs-follow-mode t))
|
|
|
|
|
|
|
|
(when treemacs-use-filewatch-mode
|
2017-12-18 07:15:55 +00:00
|
|
|
(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))))))
|
2017-10-08 16:01:48 +00:00
|
|
|
|
|
|
|
(defun treemacs/init-treemacs-evil ()
|
|
|
|
(use-package treemacs-evil
|
|
|
|
:after treemacs
|
|
|
|
:if (memq dotspacemacs-editing-style '(vim hybrid))))
|
|
|
|
|
|
|
|
(defun treemacs/init-treemacs-projectile ()
|
|
|
|
(use-package treemacs-projectile
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"fp" #'treemacs-projectile-toggle
|
|
|
|
"fP" #'treemacs-projectile)))
|
|
|
|
|
|
|
|
(defun treemacs/pre-init-winum ()
|
|
|
|
(spacemacs|use-package-add-hook winum
|
|
|
|
:post-config
|
2017-10-31 03:37:40 +00:00
|
|
|
(add-to-list 'winum-assign-functions #'treemacs--window-number-ten)))
|