mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-15 15:42:31 +01:00
Fixed accept-line and motion widgets integration
with zsh-syntax-highlighting
This commit is contained in:
parent
a0d6493f34
commit
7d737e3cc8
2 changed files with 34 additions and 31 deletions
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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue