vim commands
10 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 10 shown
-
:wqWrite file and quit vim
-
:q!Force quit discarding all changes
-
:%s/old/new/gcReplace all occurrences interactively (c = confirm)
-
vim +42 file.txtStart vim with cursor on line 42
-
/pattern (n/N next/prev) ?pattern (backward)/ searches forward, ? searches backward; n/N cycle results
-
:g/^#/dDelete all lines starting with # (comment lines)
-
gg=GGo to top (gg), re-indent to end of file (=G)
-
qa (record into a) q (stop) @a (play) 10@a (play 10 times)Macros automate repetitive edits in vim
-
:set numberToggle line numbers on (use :set nonumber to hide)
-
:vsplit other.txtVertical split; use Ctrl-w + arrow to navigate panes
no commands match — try a different search