DEV Community

Discussion on: Vim Replace Visual Star

Collapse
 
pianocomposer321 profile image
pianocomposer321

If you leave the pattern to search for out, vim will automatically re-use the "/ register. So your binding could be shortened to:

nnoremap <c-r> :%s///g<Left><Left>
Enter fullscreen mode Exit fullscreen mode

Since vim makes this so easy, I don't map this to anything myself.

Collapse
 
waylonwalker profile image
Waylon Walker

You just blew my mind, and have saved me many future keystrokes.

Collapse
 
pianocomposer321 profile image
pianocomposer321

Glad I could be of help!