zsh auto suggestion with key binding

We could bind key to zsh-autosuggestions. This is especially helpful when we use HHKB, whereas there is no such thing as left-arrow or right-arrow.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 自动建议
# zinit wait lucid light-mode for \
#     atload"_zsh_autosuggest_start; \
#         ZSH_AUTOSUGGEST_STRATEGY=(history completion) \
#         ZSH_AUTOSUGGEST_MANUAL_REBIND=0 \
#         ZSH_AUTOSUGGEST_HISTORY_IGNORE=' *' \
#         bindkey '^p' history-search-backward; \
#         bindkey '^o' history-search-forward; \
#         bindkey '^n' autosuggest-accept; \
#         bindkey '^e' autosuggest-execute; \
#         bindkey '^a' autosuggest-toggle; \
#         bindkey '^ ' autosuggest-accept" \
#     zsh-users/zsh-autosuggestions
# https://github.com/zsh-users/zsh-autosuggestions/issues/642
# For example, this would bind ctrl + space to accept the current suggestion.
zinit wait lucid light-mode for \
    atload"_zsh_autosuggest_start; \
        ZSH_AUTOSUGGEST_STRATEGY=(history completion) \
        ZSH_AUTOSUGGEST_MANUAL_REBIND=0 \
        ZSH_AUTOSUGGEST_HISTORY_IGNORE=' *' \
        bindkey '^ ' autosuggest-accept;" \
    zsh-users/zsh-autosuggestions
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=yellow'
william 支付宝支付宝
william 微信微信
0%