From 1bd84f67f196a25ad7963b8bb7088727c368b96c Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 1 Jan 2015 20:12:13 -0500 Subject: [PATCH] Add missing keybindings for neotree Next/Prevoius siblings --- doc/DOCUMENTATION.md | 17 +++++++++++------ spacemacs/extensions.el | 6 ++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/DOCUMENTATION.md b/doc/DOCUMENTATION.md index 2a1b1647d..3f02ac41c 100644 --- a/doc/DOCUMENTATION.md +++ b/doc/DOCUMENTATION.md @@ -1159,6 +1159,10 @@ To toggle the `NeoTree` buffer press: f t +The NeoTree window always has the number `0` so it does not shift the current +number of the other windows. To select the NeoTree window you then use +SPC 0. + #### NeoTree navigation Navigation is centered on the `hjkl` with the hope to provide a fast navigation @@ -1167,12 +1171,13 @@ experience like in [ranger][]: Key Binding | Description ---------------------------------|---------------------------------------------------------------- h | collapse directory +H | previous sibling j | next file or directory J | next expanded directory on level down k | previous file or directory K | parent directory, when reaching the root change it to parent directory -l | expand directory -L or RET | open file +l or RET | expand directory +L | next sibling **Note:** The point is automatically set to the first letter of a node for a smoother experience. @@ -1181,14 +1186,14 @@ smoother experience. By default a file is opened in the last active window. It is possible to choose window number where to open a file by using a numeric argument, for instance -2 L or 2 RET will open the current file in the windows 2. +2 l or 2 RET will open the current file in the windows 2. It is also possible to open the file in a split window with | and -: Key Binding | Description ----------------------------------|---------------------------------------------------------------- -L or RET | open file in last active window -# L or 2 RET| open file in window number `#` +l or RET | open file in last active window +# l or 2 RET| open file in window number `#` | | open file in an vertically split window - | open file in an horizontally split window @@ -1200,7 +1205,7 @@ Key Binding | Description c | create a node d | delete a node g | refresh -H | toggle hidden files +s | toggle showing of hidden files q or fd | hide `NeoTree` buffer r | rename a node diff --git a/spacemacs/extensions.el b/spacemacs/extensions.el index df69c9bb1..702ca8215 100644 --- a/spacemacs/extensions.el +++ b/spacemacs/extensions.el @@ -109,12 +109,14 @@ (define-key evil-motion-state-local-map (kbd "d") 'neotree-delete-node) (define-key evil-motion-state-local-map (kbd "g") 'neotree-refresh) (define-key evil-motion-state-local-map (kbd "h") 'spacemacs/neotree-collapse) - (define-key evil-motion-state-local-map (kbd "H") 'neotree-hidden-file-toggle) + (define-key evil-motion-state-local-map (kbd "H") 'neotree-select-previous-sibling-node) (define-key evil-motion-state-local-map (kbd "J") 'neotree-select-down-node) (define-key evil-motion-state-local-map (kbd "K") 'neotree-select-up-node) (define-key evil-motion-state-local-map (kbd "l") 'spacemacs/neotree-expand-or-open) + (define-key evil-motion-state-local-map (kbd "L") 'neotree-select-next-sibling-node) (define-key evil-motion-state-local-map (kbd "q") 'neotree-hide) - (define-key evil-motion-state-local-map (kbd "r") 'neotree-rename-node)) + (define-key evil-motion-state-local-map (kbd "r") 'neotree-rename-node) + (define-key evil-motion-state-local-map (kbd "s") 'neotree-hidden-file-toggle)) (evil-leader/set-key "ft" 'neotree-toggle)) :config