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.

In vim,

u = undo  
r = replace

Is there one key shortcut for redo ?

ctrl + r is a two key stroke (in my thinking),
and I often hit the wrong combination (I just recently switch to Mac)

Or is it possibile to map my own key stroke?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Of course:

:nmap r <c-r>

But I strongly recommend against you using "r" as your mapped key.

share|improve this answer
1  
noted, but i actually hardly use the replace –  ajreal Dec 12 '11 at 5:22
2  
That should be :nnoremap just in case someday ajreal remaps c-r to some other function. –  Trevor Powell Dec 12 '11 at 6:04

You could map one of the F-keys for redo by putting the following in your .vimrc

:map <F2> ^R

You can enter those special characters ( and ^R) by pressing ^V (ctrl-v) first.

For more details on entering special characters, :help i_CTRL-V

share|improve this answer

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.