How do I bind 'jk' to Esc key in Vi-Mode in tcsh shell
I love and use vim daily on tcsh. I love everything about vim. And one of the reasons why I love it so much is I dont have to lift my hands to do stuff. I have jk
mapped to Esc
key in vim. But unfortunately, I cant get the same thing on tcsh shell.
Can someone help me bindkey
jk
to Esc
on tcsh ?
Also please guide me to tcsh and vi-mode articles/tutorials/guides/tip-n开发者_如何学运维-tricks
It might help if you showed the binding command that you use in vim.
However, this might do what you're looking for:
bindkey -v
bindkey "jj" self-insert-command
bindkey -s "jk" "^["
Note: for the last command, if you type it or paste it into the command line, you will have to press Ctrl-v then j or press j twice to get the "j" character. To get "^[" you can just type those characters or you can press Ctrl-v then Esc.
After you enter these three commands (or add them to your ~/.tcshrc
and start a new shell), pressing the keys j j while in insert mode will insert the letter "j" on the command line. If you press j k while in insert mode, it will switch to command mode (like pressing Esc).
精彩评论