Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As we know, after changed the Readline mode to vi by command set -o vi and set editing-mod vi, press the key v can into an temp file to edit command (here more details). I want to disable that function.

I tried to re-map v in ~/.inputrc likes:

"v": 

but the character v cannot be inputed, even if at the insert mode (vim cannot be inputed also. =.=!).

How should I do? And how to re-map the shortcut-keys and do NOT effect the input-mode against VI Editing Mode?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You need to change the binding only for the correct mode (vi-command, not vi-insert), and you need to provide a right-hand-side to the rule:

set keymap vi-command                                                                            
v: ""
share|improve this answer
    
Nop.. if input v: "", char v cannot be input in insert mode, and command v still can open the vim to edit the command. –  Marslo May 2 '13 at 12:15
    
Did you add both lines, in that order? If yes, is there anything else in your .inputrc, and if there is, can you add the whole thing to your question? –  Gabe May 2 '13 at 15:34
    
yes!! it works!! I added the both line in .inputrc, and delete set keymap vi-insert, then, it works!! Thanks!! –  Marslo May 16 '13 at 11:59
    
I think I got it. I will set the 'v' to idle in command mode. So I should use vi-command as keymap mode. Am I right? –  Marslo May 16 '13 at 12:03
    
You can have custom mappings for all modes in the same file. The important thing to know is that lines are processed strictly in order: after a set keymap line, all mappings apply to that mode, until the next set keymap line, and any mappings after that will apply to the new mode. –  Gabe May 16 '13 at 16:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.