Skip to content

Commit

Permalink
Restore omitted menu keybindings for tab and shift-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed Apr 4, 2024
1 parent 12e1a7f commit 5cd2221
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Functions/Init/.autocomplete__key-bindings
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ ${0}:bind() {
${0}:bind up-line-or-search up-history '^P' 'k' $key_up[@]
${0}:bind down-line-or-select down-history '^N' 'j' $key_down[@]

local backtab=$terminfo[kcbt]

menukeys+=(
'\t' accept-line
'^@' accept-and-hold
'^[v' accept-and-hold
'^_' undo
'^[u' undo
"$terminfo[kpp]" backward-word
"$terminfo[knp]" forward-word
)
bindkey -M menuselect -s "$backtab" "^_$backtab"


local backtab=$terminfo[kcbt]
main+=(
'\t' complete-word
"$backtab" insert-unambiguous-or-complete
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bindkey "$terminfo[kcbt]" menu-select
#### Make <kbd>Tab</kbd> and <kbd>Shift</kbd><kbd>Tab</kbd> change the selection in the menu
This makes <kbd>Tab</kbd> and <kbd>Shift</kbd><kbd>Tab</kbd> move the selection in the menu right
and left, respectively, instead of exiting the menu or exiting menu search:
and left, respectively, instead of exiting the menu:
```sh
bindkey -M menuselect '^I' menu-complete
bindkey -M menuselect "$terminfo[kcbt]" reverse-menu-complete
Expand Down Expand Up @@ -161,7 +161,6 @@ bindkey '^S' .history-incremental-search-forward
```

### Pass arguments to `compinit`

If necessary, you can let Autocomplete pass arguments to `compinit` as follows:
```sh
zstyle '*:compinit' arguments -D -i -u -C -w
Expand Down

0 comments on commit 5cd2221

Please sign in to comment.