Skip to content

Commit

Permalink
Keys consistency for winum and file trees
Browse files Browse the repository at this point in the history
Reinstate `SPC f T` binding, and make `SPC 0` and `M-0` consistent across
Neotree and Treemacs.
  • Loading branch information
bmag committed Feb 2, 2018
1 parent 64cf9f5 commit f3b6a22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions layers/+filetree/neotree/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,15 @@ Navigation^^^^ Actions^^ Visual actions/config^^^

(spacemacs/set-leader-keys
"ft" 'neotree-toggle
"fT" 'neotree-show
"pt" 'neotree-find-project-root))
:config
(spacemacs//neotree-key-bindings)))

(defun neotree/pre-init-winum ()
(spacemacs|use-package-add-hook winum
:post-config
(add-to-list 'winum-assign-functions #'spacemacs//winum-neotree-assign-func)))

(defun neotree/post-init-winum ()
(spacemacs/set-leader-keys
;; window 0 is reserved for file trees
"0" 'neotree-show))
(spacemacs/set-leader-keys "0" #'neotree-show)
(define-key winum-keymap (kbd "M-0") #'neotree-show)
(add-to-list 'winum-assign-functions #'spacemacs//winum-neotree-assign-func)))
6 changes: 4 additions & 2 deletions layers/+filetree/treemacs/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

(defun treemacs/init-treemacs ()
(use-package treemacs
:commands treemacs--window-number-ten
:commands (treemacs-select-window treemacs--window-number-ten)
:defer t
:init
(spacemacs/set-leader-keys
"ft" #'treemacs-toggle
"fT" #'treemacs
"fB" #'treemacs-bookmark
"f C-t" #'treemacs-find-file)
:config
Expand Down Expand Up @@ -76,5 +77,6 @@
(spacemacs|use-package-add-hook winum
:post-config
(progn
(spacemacs/set-leader-keys "0" #'treemacs)
;; window 0 is reserved for file trees
(spacemacs/set-leader-keys "0" #'treemacs-select-window)
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))))

1 comment on commit f3b6a22

@flash-gordon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmag thanks for this ❤️

Please sign in to comment.