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
|
2018-11-20 19:55:37 +00:00
|
|
|
'(
|
|
|
|
golden-ratio
|
2017-10-08 16:01:48 +00:00
|
|
|
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
|
2018-11-20 19:55:37 +00:00
|
|
|
winum
|
|
|
|
))
|
2017-08-07 06:37:47 +00:00
|
|
|
|
|
|
|
(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
|
2018-08-31 21:28:12 +00:00
|
|
|
:commands (treemacs-select-window treemacs--window-number-ten
|
|
|
|
treemacs-current-visibility)
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2017-08-07 06:37:47 +00:00
|
|
|
:init
|
|
|
|
(progn
|
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)
|
2018-10-11 16:58:53 +00:00
|
|
|
(add-hook 'treemacs-mode-hook
|
|
|
|
#'spacemacs/treemacs-setup-width-lock)
|
2018-05-28 15:12:16 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2018-08-31 21:25:05 +00:00
|
|
|
"ft" 'treemacs
|
|
|
|
"fB" 'treemacs-bookmark
|
|
|
|
"fT" 'treemacs-find-file
|
2018-08-31 21:28:12 +00:00
|
|
|
"f M-t" 'treemacs-find-tag
|
|
|
|
"pt" 'spacemacs/treemacs-project-toggle)
|
2018-09-09 12:55:15 +00:00
|
|
|
(which-key-add-major-mode-key-based-replacements 'treemacs-mode
|
|
|
|
"c" "treemacs-create"
|
|
|
|
"o" "treemacs-visit-node"
|
|
|
|
"oa" "treemacs-visit-node-ace"
|
|
|
|
"t" "treemacs-toggles"
|
|
|
|
"y" "treemacs-copy"
|
|
|
|
"C-p" "treemacs-projects"
|
|
|
|
"C-p c" "treemacs-projects-collapse"))
|
2018-05-28 15:12:16 +00:00
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(spacemacs/define-evil-state-face "treemacs" "MediumPurple1")
|
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))
|
2018-05-25 05:39:15 +00:00
|
|
|
(when (memq treemacs-use-git-mode '(simple extended))
|
2018-05-14 21:05:07 +00:00
|
|
|
(treemacs-git-mode treemacs-use-git-mode))
|
2018-10-04 10:01:49 +00:00
|
|
|
(add-to-list 'spacemacs-window-split-ignore-prefixes
|
|
|
|
treemacs--buffer-name-prefix))))
|
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
|
2018-05-25 05:39:15 +00:00
|
|
|
:after treemacs
|
|
|
|
:defer t))
|
2017-10-08 16:01:48 +00:00
|
|
|
|
|
|
|
(defun treemacs/pre-init-winum ()
|
|
|
|
(spacemacs|use-package-add-hook winum
|
|
|
|
:post-config
|
2017-11-26 15:00:04 +00:00
|
|
|
(progn
|
2018-02-02 19:15:21 +00:00
|
|
|
;; window 0 is reserved for file trees
|
2018-08-31 21:25:05 +00:00
|
|
|
(spacemacs/set-leader-keys "0" 'treemacs-select-window)
|
|
|
|
(define-key winum-keymap (kbd "M-0") 'treemacs-select-window))))
|