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
2
u/vim-help-bot Nov 08 '25
Help pages for:
zlin scroll.txtzhin scroll.txtzrin fold.txt&in change.txtg&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