Last Updated: February 25, 2016
·
1.921K
· akalyaev

Vim: Repeat everything

In Vim, you could repeat almost everything.

  • . to repeat last change action in normal mode
  • @: to repeat last command-line change
  • @@ to repeat last macro
  • n, N to repeat searches
  • & to repeat substititution
  • :&& to repeat substititution with the same flags
  • g& to repeat substititution globally
  • repeat.vim to repeat some of not native commands

P.S. Happy coding!

1 Response
Add your response

[Optionally] Add this to your .vimrc to always preserve flags when using &:

" make & trigger :&& so it preserves flags
nnoremap & :&&<Enter>
xnoremap & :&&<Enter>
over 1 year ago ·