vim Command Examples

Vim (Vi IMproved), a command-line text editor, provides several modes for different kinds of text manipulation. Pressing <i> in normal mode enters insert mode. Pressing <Esc> goes back to normal mode, which enables the use of Vim commands. See also: vimdiff, vimtutor, nvim. More information: https://www.vim.org.

vim {{path/to/file}}

vim +{{line_number}} {{path/to/file}}

<:>help<Enter>

{{<Esc><Z><Z>|<Esc><:>x<Enter>|<Esc><:>wq<Enter>}}

<Esc><u>

</>{{search_pattern}}<Enter>

<:>%s/{{regular_expression}}/{{replacement}}/g<Enter>

<:>set nu<Enter>