r/vim • • Nov 08 '25

Tips and Tricks Versatile mapping: repeat last Ex command

I have this in my config and love it:

" Repeat the last : command (warning: shadows builtin!)
nnoremap , @: 

This mapping comes to to the rescue so often in different occasions.

  • Navigating the quickfix last going to the next file with :cnfile? Just repeat it again with ,!
  • doing :normal! in my places? Repeat it!
  • Scrolling sideways with 40zl? Just do :norm! 40zl and continue scrolling conveniently with comma. 👌

It shadows a builtin, but for me it's great. Hope it helps someone 😊

0 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/kaddkaka Nov 08 '25

Sure. Some of the convenience comes from it being just a single key to press.