Vim in essence has two modes - INSERT
and NORMAL
. You enter text in INSERT
mode, everything else you do in NORMAL
mode. When you open vim you land in the NORMAL
mode; to get to INSERT
mode type i
, and vim is ready to insert right where you are, or o
and vim will create a new line and put the cursor at the beginning of the new line for insertion. To escape out of insert mode type esc
or Ctrl + C
- If a key includes a
+
it means the two have to typed together, likeCTRL + F
- If it doesn't then they have to be typed in sequence, like
dd
.
# | Action | Key |
---|---|---|
1 | Next word | w |
2 | End of next word | e |
3 | Previous word | b |
4 | End of the previous word | ge |
5 | Next sentence | ) |
6 | Previous sentence | ( |
7 | Next paragraph | } |
8 | EOF | G |
9 | BOF | g |
10 | Next page | Ctrl + F |
11 | Previous page | Ctrl + B |
12 | Specific line | line number |
13 | End of line | $ |
14 | Beginning of line | 0 |
# | Action | Key |
---|---|---|
1 | Foward | / |
2 | Next ocuurence | n |
3 | Backward | ? |
4 | Next occurence of current word | * |
5 | Previous occuremnce of current word | # |
# | Action | Key |
---|---|---|
1 | Delete word | dw |
2 | Delete line | dd |
3 | Delete sentence | d) |
4 | Change word | cw |
5 | Change sentence | cc |
6 | Undo | u |
# | Action | Key |
---|---|---|
1 | Copy word | yw |
2 | Paste word | P |
# | Action | Key |
---|---|---|
1 | Open a new file in the same window | :new filename |
2 | Move between buffers | Ctrl+w w |
3 | Close a buffer | Ctrl + w c |
4 | Edit a file | :e filename |
5 | Open a directory | :e . |
6 | Open a file in a directory | Select the filename and Enter |
7 | Delete buffer | :bd |
8 | Next buffer | :bn |
9 | Previous buffer | :bp |
10 | Specific buffer | :b |
11 | All buffers | :ls |