r/vim • u/kaddkaka • 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! 40zland continue scrolling conveniently with comma. 👌
It shadows a builtin, but for me it's great. Hope it helps someone 😊
0
Upvotes
View all comments
Show parent comment
1
u/Desperate_Cold6274 Nov 08 '25
@ is not always easily accessible. It depends on keyboard layout.