How do I disable a keybinding if I don't know what it is or what it's triggering?
I have my zsh
key mode set to vi-mode, through bindkey -v
.
To do a history search, I press Esc to get to "command mode", and then / to start the search. However, if I press them too fast, it does something else, but I don't know what! I assume Esc-/
is some keybinding, but I don't know what it is. How do I find this and turn it off?
Best Answer
After some searching, I've found the answer:
To discover what
escape sequence
the key combination is triggering, follow this excellent answer:echo "
CtrlVEsc/"
Which displays, for me, as:
echo "^[/"
. CtrlV forces the following key to display as an escape sequence instead of being interpreted. So now we know we're trying to find what is bound to"^[/"
.To list all zsh key bindings, simply execute
bindkey
with no args:So, having decided that I don't care about
_history-complete-older
, I'm just going to remove it. I added this to my.zshrc
:If, instead, you just want to rebind it to some other key, you might use: