I'm using Vim /etc/zsh/zshrc
to add key bindings for zsh
because it doesn't work with inputrc
. In my terminal with tmux when I type Ctrl+v then Ctrl+LeftArrow the shell will show ^[OD
. However, when I'm in Vim insert mode, pressing the same sequence will result in ^[[D
.
I found out that ^[[D
is what the shell produces when I type Ctrl+v then LeftArrow. I have also changed ^[[D
to ^[OD
in the file /etc/zsh/zshrc
and it works as expected (pressing Ctrl+LeftArrow causes the cursor to move back a word). Here is the line I'm talking about:
bindkey "^[OD" backward-word
I guess something is wrong with Vim because it's consuming the Ctrl. How do I fix this?