106 lines
3.5 KiB
EmacsLisp
106 lines
3.5 KiB
EmacsLisp
;;; init-treemacs.el --- -*- lexical-binding: t -*-
|
|
;;
|
|
;; Filename: init-treemacs.el
|
|
;; Description: Initialize Treemacs
|
|
;; Author: Mingde (Matthew) Zeng
|
|
;; Copyright (C) 2019 Mingde (Matthew) Zeng
|
|
;; Created: Fri Mar 15 09:56:12 2019 (-0400)
|
|
;; Version: 2.0.0
|
|
;; Last-Updated: Tue Dec 24 11:56:52 2019 (-0500)
|
|
;; By: Mingde (Matthew) Zeng
|
|
;; URL: https://github.com/MatthewZMD/.emacs.d
|
|
;; Keywords: M-EMACS .emacs.d treemacs
|
|
;; Compatibility: emacs-version >= 26.1
|
|
;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;
|
|
;;; Commentary:
|
|
;;
|
|
;; This initializes treemacs
|
|
;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;
|
|
;; This program is free software: you can redistribute it and/or modify
|
|
;; it under the terms of the GNU General Public License as published by
|
|
;; the Free Software Foundation, either version 3 of the License, or (at
|
|
;; your option) any later version.
|
|
;;
|
|
;; This program is distributed in the hope that it will be useful, but
|
|
;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
;; General Public License for more details.
|
|
;;
|
|
;; You should have received a copy of the GNU General Public License
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
|
;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;
|
|
;;; Code:
|
|
|
|
;; TreemacsPac
|
|
(use-package treemacs
|
|
:init
|
|
(with-eval-after-load 'winum
|
|
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
|
|
:custom
|
|
(treemacs-collapse-dirs 3)
|
|
(treemacs-deferred-git-apply-delay 0.5)
|
|
(treemacs-display-in-side-window t)
|
|
(treemacs-file-event-delay 5000)
|
|
(treemacs-file-follow-delay 0.2)
|
|
(treemacs-follow-after-init t)
|
|
(treemacs-follow-recenter-distance 0.1)
|
|
(treemacs-git-command-pipe "")
|
|
(treemacs-goto-tag-strategy 'refetch-index)
|
|
(treemacs-indentation 2)
|
|
(treemacs-indentation-string " ")
|
|
(treemacs-is-never-other-window nil)
|
|
(treemacs-max-git-entries 5000)
|
|
(treemacs-no-png-images nil)
|
|
(treemacs-no-delete-other-windows t)
|
|
(treemacs-project-follow-cleanup nil)
|
|
(treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory))
|
|
(treemacs-recenter-after-file-follow nil)
|
|
(treemacs-recenter-after-tag-follow nil)
|
|
(treemacs-show-cursor nil)
|
|
(treemacs-show-hidden-files t)
|
|
(treemacs-silent-filewatch nil)
|
|
(treemacs-silent-refresh nil)
|
|
(treemacs-sorting 'alphabetic-desc)
|
|
(treemacs-space-between-root-nodes t)
|
|
(treemacs-tag-follow-cleanup t)
|
|
(treemacs-tag-follow-delay 1.5)
|
|
(treemacs-width 35)
|
|
:config
|
|
;; The default width and height of the icons is 22 pixels. If you are
|
|
;; using a Hi-DPI display, uncomment this to double the icon size.
|
|
;;(treemacs-resize-icons 44)
|
|
(treemacs-follow-mode t)
|
|
(treemacs-filewatch-mode t)
|
|
(treemacs-fringe-indicator-mode t)
|
|
:bind
|
|
(("M-0" . treemacs-select-window)
|
|
("C-x t 1" . treemacs-delete-other-windows)
|
|
("C-x t t" . treemacs)
|
|
("C-x t B" . treemacs-bookmark)
|
|
("C-x t C-t" . treemacs-find-file)
|
|
("C-x t M-t" . treemacs-find-tag))
|
|
(:map treemacs-mode-map ("C-p" . treemacs-previous-line)))
|
|
;; -TreemacsPac
|
|
|
|
;; TreeMagit
|
|
(use-package treemacs-magit
|
|
:defer t
|
|
:after (treemacs magit))
|
|
;; -TreeMagit
|
|
|
|
;; TreeProj
|
|
(use-package treemacs-projectile
|
|
:defer t
|
|
:after (treemacs projectile))
|
|
;; -TreeProj
|
|
|
|
(provide 'init-treemacs)
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;; init-treemacs.el ends here
|