Date: 26/11/2024
| Command | Description |
|---|---|
:w |
Save changes |
:q |
Quit Vim |
i |
Enter insert mode |
Esc |
Exit insert mode |
| Command | Description |
|---|---|
h |
Move left |
j |
Move down |
k |
Move up |
l |
Move right |
| Command | Description |
|---|---|
x |
Delete the character under the cursor |
dd |
Delete the current line |
yy |
Copy (yank) the current line |
p |
Paste after the cursor |
| Command | Description |
|---|---|
/pattern |
Search for pattern |
n |
Repeat the last search forward |
N |
Repeat the last search backward |
:%s/old/new/g |
Replace all occurrences of ‘old’ with ‘new’ |
| Command | Description |
|---|---|
:tabnew |
Open a new tab |
:split |
Split the window horizontally |
:vsplit |
Split the window vertically |
Ctrl-w w |
Switch between windows |
| Command | Description |
|---|---|
qa |
Start recording macro in register a |
q |
Stop recording |
@a |
Execute macro in register a |
@@ |
Replay the last executed macro |
| Command | Description |
|---|---|
:w |
Save the current file |
:wq |
Save and quit |
:q! |
Quit without saving |
:x or ZZ |
Save and quit |