Skip to main content

Vim

Vim (Vi Improved) is a powerful text editor with different modes for editing and commands.

CommandDescription
vim file.txtOpen or create a file
iEnter insert (edit) mode
EscExit insert mode
:wSave changes
:qQuit
:wqSave and quit
:q!Quit without saving
/wordSearch for a word
nGo to next search match
:%s/old/new/gReplace all “old” with “new”

Example:

vim notes.txt

Type i to start editing.
When finished, press Esc, then type :wq to save and exit.