Fixed accept-line and motion widgets integration

with zsh-syntax-highlighting
This commit is contained in:
Thiago de Arruda
2013-11-08 08:20:57 -03:00
parent a0d6493f34
commit 7d737e3cc8
2 changed files with 34 additions and 31 deletions

View File

@@ -17,15 +17,23 @@ zle-line-init() {
}
zle -N zle-line-init
# use ctrl+t to toggle autosuggestions(hopefully this wont be needed)
# use ctrl+t to toggle autosuggestions(hopefully this wont be needed as
autosuggestions is designed to be unobtrusive)
bindkey '^T' autosuggest-toggle
# use ctrl+f to accept suggestions
bindkey '^F' autosuggest-accept-suggested-small-word
# or
bindkey '^F' autosuggest-accept-suggested-word
EOF
```
I recommend binding ctrl+f to autosuggest-accept-suggested-small-word, as the
[zsh-history-substring-search](https://github.com/zsh-users/zsh-history-substring-search)
plugin will already provide a key to accept the entire suggestion
Any widget that moves the cursor to the right(forward-word, forward-char...)
will accept parts of the suggested text. For example, vi-mode users can do
this:
```sh
# Accept suggestions without leaving insert mode
bindkey '^f' vi-forward-word
# or
bindkey '^f' vi-forward-blank-word
```
Emacs-mode users can simply use alt+f which is bound to forward-word
The [zsh-history-substring-search](https://github.com/zsh-users/zsh-history-substring-search)
plugin is also recommended.