Skip to main content
stinky.blog

vim

vimtutor to launch tutorial

General #

Starts in command mode, press i for insert mode or a for append mode

Escape to re-enter command mode

:w -- Save file

:q -- Quit

:wq -- Save and quit

:q! -- Quit without saving

o -- enters insert mode on a new line

Text Operations #

dd -- delete current line

yy -- copy current line

p -- paste current line

u -- undo

ctrl+r -- redo

:%s/oldword/newword/g -- substitute phrase -- /g = all instances

Visual mode #

v -- enter visual mode

highlight text starting from current cursor position then copy/paste/delete/etc

gg -- top of document

G -- end of document

/word -- search for "word"

?word -- search backwards for "word"

^ -- move to beginning of line

$ -- move to end of line

w -- move to next word

Display #

:se numbers -- show line numbers


this page written proudly in nano