1
0
Fork 0

Add autosuggestions module

The modules uses zsh-autosuggestions as an external submodule and defines
useful keybindings for vi-mode.
pull/1060/head
Tobias Witt 9 years ago
parent 7227c4f0be
commit ac3186df63
No known key found for this signature in database
GPG Key ID: F4AB9D0041E48E7E

3
.gitmodules vendored

@ -16,3 +16,6 @@
[submodule "modules/prompt/functions/pure"] [submodule "modules/prompt/functions/pure"]
path = modules/prompt/external/pure path = modules/prompt/external/pure
url = https://github.com/sindresorhus/pure.git url = https://github.com/sindresorhus/pure.git
[submodule "modules/autosuggestions/external/zsh-autosuggestions"]
path = modules/autosuggestions/external/zsh-autosuggestions
url = https://github.com/tarruda/zsh-autosuggestions

@ -0,0 +1,10 @@
# ZSH Autosuggestions
This plugin enables [zsh-autosuggestions](https://github.com/tarruda/zsh-autosuggestions) and adds
vi-mode compatible keybindings.
## Keybindings
* `CTRL-F` is bound to `vi-forward-word`, it is equivalent to hitting `w` in vim and accepts the
suggestion word by word
* `CTRL-K` is bound to `vi-end-of-line` which effectively accepts the suggestion

@ -0,0 +1 @@
Subproject commit 7a00bfa444fcd474bce9c56119d573afa2b51aba

@ -0,0 +1,13 @@
source "${0:h}/external/zsh-autosuggestions/autosuggestions.zsh" || return 1
zle-line-init() {
zle autosuggest-start
}
zle -N zle-line-init
zstyle -s ':prezto:module:editor' key-bindings 'key_bindings'
if [[ "$key_bindings" == vi ]]; then
bindkey '' vi-forward-word
bindkey ' ' vi-end-of-line
fi
Loading…
Cancel
Save