Skip to content

Commit

Permalink
Change TAB behavior: toggle hiding #19
Browse files Browse the repository at this point in the history
  • Loading branch information
bmag committed Feb 11, 2016
1 parent 33c774a commit 9e76bf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 15,10 @@ The imenu of the current buffer will be displayed in the `*Ilist*` buffer. From
- `<enter>`: goto entry under cursor, or toggle case-folding.
- `<space>`: display entry under cursor, but `*Ilist*` buffer remains current
- `<mouse click>`: same as \<enter\>
- `<tab>`: next line
- `<backtab>`: previous line
- `<tab>`: expand/collapse subtree (`hs-toggle-hiding`)
- `f`: same as \<tab\>
- `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`:
Expand Down
9 changes: 2 additions & 7 deletions imenu-list.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 32,7 @@
;; Key shortcuts from "*Ilist*" buffer:
;; <enter>: Go to current definition
;; <space>: display current definition
;; <tab>: expand/collapse subtree
;;
;; Change "*Ilist*" buffer's position and size:
;; `imenu-list-position', `imenu-list-size'.
Expand Down Expand Up @@ -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>". "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 "<S-iso-lefttab>") #'previous-line)
(define-key map (kbd "<S-tab>") #'previous-line)
(define-key map (kbd "<backtab>") #'previous-line)
(define-key map (kbd "TAB") #'hs-toggle-hiding)
(define-key map (kbd "f") #'hs-toggle-hiding)
map))

Expand Down

0 comments on commit 9e76bf3

Please sign in to comment.