From 9e76bf3fd84aef553313b9e4a887e80196ff2f51 Mon Sep 17 00:00:00 2001 From: bmag Date: Thu, 11 Feb 2016 13:40:56 +0200 Subject: [PATCH] Change TAB behavior: toggle hiding #19 --- README.md | 5 ++--- imenu-list.el | 9 ++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f43ef35..b95c503 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,10 @@ The imenu of the current buffer will be displayed in the `*Ilist*` buffer. From - ``: goto entry under cursor, or toggle case-folding. - ``: display entry under cursor, but `*Ilist*` buffer remains current - ``: same as \ -- ``: next line -- ``: previous line +- ``: expand/collapse subtree (`hs-toggle-hiding`) +- `f`: same as \ - `n`: next line - `p`: previous line -- `f`: toggle case-folding (`hs-toggle-hiding`) Some users might prefer the `imenu-list-minor-mode` command to also set the focus to the `*Ilist*` window. To do so, use the variable `imenu-list-focus-after-activation`: diff --git a/imenu-list.el b/imenu-list.el index e273fe7..67af366 100644 --- a/imenu-list.el +++ b/imenu-list.el @@ -32,6 +32,7 @@ ;; Key shortcuts from "*Ilist*" buffer: ;; : Go to current definition ;; : display current definition +;; : expand/collapse subtree ;; ;; Change "*Ilist*" buffer's position and size: ;; `imenu-list-position', `imenu-list-size'. @@ -518,13 +519,7 @@ If the imenu-list buffer doesn't exist, create it." (define-key map (kbd "SPC") #'imenu-list-display-entry) (define-key map (kbd "n") #'next-line) (define-key map (kbd "p") #'previous-line) - ;; not sure if "TAB" is better than "". "TAB" and "C-i" are the same, - ;; but we don't want to prevent users from accessing C-i if they want to - ;; (specifically relevant to evil-jumper, which uses C-i) - (define-key map (kbd "TAB") #'next-line) - (define-key map (kbd "") #'previous-line) - (define-key map (kbd "") #'previous-line) - (define-key map (kbd "") #'previous-line) + (define-key map (kbd "TAB") #'hs-toggle-hiding) (define-key map (kbd "f") #'hs-toggle-hiding) map))