Vim Tips

Feb 03, 22

Replace in visual mode

  • enter visual mode
  • make the selection
  • press :
  • then s/find/replace/g

taken together it will look like this:

'<,'>s/find/replace/g

note that you do not need : or % as a prefix, otherwise you will receive an error:

E488: Trailing characters: /find/replace/g

View last command

  • press :
  • press CTRL + P

Change case

SHIFT + ~

Block Select

CTRL+V

Increment numbers

enter visual mode -> CTRL + A

Decrement numbers

enter visual mode -> CTRL + Z