Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .