Replace speedbar with treemacs

This commit is contained in:
Wojciech Kozlowski 2019-03-17 00:39:40 +01:00
parent c8b71004ee
commit a037daabe4

View File

@ -24,7 +24,10 @@
ibuffer-vc
rainbow-mode
pdf-tools
sr-speedbar
treemacs
treemacs-projectile
treemacs-icons-dired
treemacs-magit
which-key
use-package)
@ -100,30 +103,6 @@
(use-package rainbow-mode
:defer t)
;; --------------------------------------------------------------------------
;; Speedbar.
;; --------------------------------------------------------------------------
(use-package sr-speedbar
:defer t
:bind
(("C-c s" . sr-speedbar-toggle))
:config
(setq-default
sr-speedbar-skip-other-window-p t
sr-speedbar-right-side nil
speedbar-show-unknown-files t
sr-speedbar-delete-windows t)
(defun goto-speedbar ()
"Set the speedbar window as the active window."
(interactive)
(if (window-live-p sr-speedbar-window)
(set-frame-selected-window (window-frame) sr-speedbar-window)
(user-error "Speedbar window is not live")))
(global-set-key (kbd "M-m") #'goto-speedbar))
;; --------------------------------------------------------------------------
;; Keep point in same position on the screen when scrolling.
;; --------------------------------------------------------------------------
@ -284,6 +263,77 @@
;; --------------------------------------------------------------------------
(setq exec-path (append exec-path '("/home/wojtek/.local/bin")))
(use-package treemacs
:defer t
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-m") #'treemacs-select-window))
:config
(progn
(setq treemacs-collapse-dirs (if (executable-find "python") 3 0)
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-git-command-pipe ""
treemacs-goto-tag-strategy 'refetch-index
treemacs-indentation 2
treemacs-indentation-string " "
treemacs-is-never-other-window t
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-distance 0.1
treemacs-recenter-after-file-follow nil
treemacs-recenter-after-tag-follow nil
treemacs-recenter-after-project-jump 'always
treemacs-recenter-after-project-expand 'on-distance
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)
;; 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)
(pcase (cons (not (null (executable-find "git")))
(not (null (executable-find "python3"))))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple))))
:bind
(:map global-map
("M-m" . 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)))
(use-package treemacs-projectile
:after treemacs projectile)
(use-package treemacs-icons-dired
:after treemacs dired
:config (treemacs-icons-dired-mode))
(use-package treemacs-magit
:after treemacs magit)
)
(provide 'em-emacs)