In my .vimrc file I have the line
inoremap jj << Esc>>
(I can’t live without this :))
I wish to have the same remap while using ksh in set -o vi mode, any advice on how to do this is appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Give this a try:
Put it in a file,
~/.input.kshfor example, and source it from your~/.kshrcor similar.Pressing “j” will put it on hold. If the time runs out before pressing another “j”, the first “j” will be output and the next one will be held. If another key besides “j” is pressed, the held “j” and the next character are output together. If a second “j” is pressed before time runs out, the remapped sequence will be output.
Example: Pressing “j”, pause, then press “jj” will yield no response at first then “j<< Esc>>” all at once.
A difference between this and
vimis thatvimwill go ahead and output the held character after the time runs out even if another key hasn’t been pressed yet. Also, the timeout in this is in whole seconds, while invimit’s in milliseconds.I’ve only tested this a little and only with ksh93.
Edit: Added cursor color change.