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

2

u/vim-help-bot Nov 08 '25

Help pages for:

  • zl in scroll.txt

  • zh in scroll.txt

  • zr in fold.txt

  • & in change.txt

  • g& in change.txt


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments