tags:

views:

178

answers:

1

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

+1  A: 

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).

Dennis Williamson
Thanks. Will try out and let you know. Appreciate the help.
jeffjose