3

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?

2 Answers 2

3

Of course:

:nmap r <c-r>

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

2
  • 1
    noted, but i actually hardly use the replace
    – ajreal
    Dec 12, 2011 at 5:22
  • 2
    That should be :nnoremap just in case someday ajreal remaps c-r to some other function. Dec 12, 2011 at 6:04
0

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

You must log in to answer this question.

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