Fixed accept-line and motion widgets integration
with zsh-syntax-highlighting
This commit is contained in:
28
README.mkd
28
README.mkd
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user