Most editors treat inserting text as the primary action. Vim treats changing text as the primary action.
- Verb + Noun (e.g.
dw
- "delete word")
Act upon Motions or Text Objects.
d
- deletec
- change (delete and enter Insert mode)>
- Indentv
- visually selecty
- yank (copy)
w
- forward by a wordb
- back by a word2j
- down 2 lines
iw
- inner word (works from anywhere in a word)it
- inner tag (contents of HTML or XML tag)i"
- inner quotesip
- inner paragraphas
- a sentence
f
,F
- find the next charactert
,T
- till the next character/
- search:noh
- to clear search highlighting.
- Try to use Text Objects instead of Motions for maximum repeatability with the dot operator.
- Visual mode is a smell.
- Breaks repeatability.
:h vimrc
- Reload vim configuration
:so %
-%
stands for current file name (see:h current-file
) and:so
is short for:source
, which reads the content of the specified file and treats it as Vim code.
- Ctrl + W, s - Open horizontal split.
- Ctrl + W, v - Open vertical split.
- Ctrl + o - Jump out.
- Ctrl + i - Jump in.
:h ju
- Paste into vim from system clipboard
"+p
-"
Use register,+
the plus register for system clipboard, and paste contents.
- How to copy ("yank") text into your buffer and paste it over a word
viwp
- Visual select inner word and paste
- Save and Quit
ZZ
in command mode