Skip to content

VIM (and VI)

Quit VI and VIM

:q - Quit
:q! - Force Quit, DO NOT SAVE
:wq - Write (Save) Changes & Quit
:wq! - Write Changes & Force Quit

Paste Mode aka stop trying to be helpful and format things for me

:set paste

Search and Replace

:%s/STRING_OR_REGEX/REPLACE_WITH/g > :%s/BADSTRING/GOODSTRING/g > :%s/192\.168\.100\.100/10.100.100.100/g

Remove Trailing Whitespaces

:%s/\s\+$//

Macro Mode

qq