Vim Starter


A Vim starter kit, followed by some advanced commands in a separate block:

Vim Starter Kit:

" Basic movement
h - move left
j - move down
k - move up
l - move right

" Modes
i - enter insert mode
Esc - return to normal mode
v - enter visual mode

" Saving and quitting
:w - save file
:q - quit (close file)
:wq - save and quit

" Editing
x - delete character under cursor
dd - delete current line
yy - copy (yank) current line
p - paste after cursor
u - undo
Ctrl + r - redo

" Searching
/pattern - search forward for pattern
n - move to next search result
N - move to previous search result

" File navigation
:e filename - open file for editing
:bn - go to next buffer
:bp - go to previous buffer

" Help
:help - open Vim help

Advanced Vim Commands:

" Advanced movement
w - move to start of next word
b - move to start of previous word
0 - move to start of line
$ - move to end of line
gg - go to first line of file
G - go to last line of file

" Text objects
iw - inner word
it - inner tag
i" - inner quotes

" Multiple windows
:sp - split window horizontally
:vsp - split window vertically
Ctrl + w, arrow key - navigate between windows

" Macros
qa - start recording macro 'a'
q - stop recording macro
@a - play macro 'a'

" Marks
ma - set mark 'a' at current position
'a - jump to line of mark 'a'
`a - jump to position of mark 'a'

" Folding
zf - create fold
zo - open fold
zc - close fold

" Command-line
:!command - execute external command

" Registers
"ay - yank into register 'a'
"ap - paste from register 'a'

" Global commands
:g/pattern/command - execute command on lines matching pattern

This starter kit provides essential commands for beginners, while the advanced block offers more powerful features for users ready to expand their Vim skills. Good luck to your fingers.