Skip to content

Instantly share code, notes, and snippets.

@mauricios
Created February 16, 2018 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauricios/4f9ba48c279ec0109db3c3b498e0a709 to your computer and use it in GitHub Desktop.
Save mauricios/4f9ba48c279ec0109db3c3b498e0a709 to your computer and use it in GitHub Desktop.
Vim powers
- Search and replace: :%s/foo/bar/g
- Delete text block: ma + d'a
- Macro: qd, <commands>, then q, apply with @d and @@
- Write as sudo: :w !sudo tee %
- Increase/Decrease number: Ctl+A Ctl+X
- Go to end of file: G
- Copy/Paste text block: [m]+[x], [y]+[']+[x] and [p]
- Open in insert mode: vi +%d +star filename.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment