Closed alexzanderr closed 2 years ago
Type into zsh: bindkey '
and then press ctrl + V and the right arrow key then add the closing '
and press enter.
When I do this I get the following:
% bindkey '^[[C'
"^[[C" vi-forward-char
That means that my right arrow key is bound to the vi-forward-char
widget. Yours may be bound to plain forward-char
or something else.
You need to remove whatever widget your right arrow key is bound to from the ZSH_AUTOSUGGEST_ACCEPT_WIDGETS
array. In my case, to remove vi-forward-char
, I would add this to my ~/.zshrc
file:
# Based on this stack overflow answer of how to remove an element from an array
# https://stackoverflow.com/a/25172688/154703
ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[$ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[(i)vi-forward-char]]=()
having this in .zshrc
:
ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[$ZSH_AUTOSUGGEST_ACCEPT_WIDGETS[(i)forward-char]]=()
disables the auto suggestion complete. thanks.
but how do i remap to tab
or something else ?
i want to remap to this key '^[c'
(alt+c)
.
how do i achieve that?
Try bindkey '^[c' autosuggest-accept
works like a charm. thanks.
by default the
right arrow
key triggers autosuggestion completion. okey.i want to disable it, because when i paste commands and i navigate with arrows to edit the auto suggestion messes up my command and i have to start over.
hoping for help. thanks