Working with Multiple Files
Buffers
| - | - |
|---|---|
:e file |
Edit a file in a new buffer |
:bn |
Go to the next buffer |
:bp |
Go to the previous buffer |
:bd |
Remove file from buffer list |
:b 5 |
Open buffer #5 |
:b file |
Go to a buffer by file |
:ls |
List all open buffers |
:sp file |
Open and split window |
:vs file |
Open and vertically split window |
:hid |
Hide this buffer |
:wn |
Write file and move to next |
:tab ba |
Edit all buffers as tabs |
Windows
| - | - |
|---|---|
<C-w> s |
Split window |
<C-w> v |
Split window vertically |
<C-w> w |
Switch windows |
<C-w> q |
Quit a window |
<C-w> T |
Break out into a new tab |
<C-w> x |
Swap current with next |
<C-w> - / + |
Decrease/Increase height |
<C-w> < / > |
Decrease/Increase width |
<C-w> | |
Max out the width |
<C-w> _ |
Max out the height |
<C-w> = |
Equally high and wide |
<C-w> h / l |
Go to the left/right window |
<C-w> j / k |
Go to the up/down window |
Tabs
| Shortcut | Description |
|---|---|
:tabe [file] |
|
:tabf [file] |
Open if exists in new tab |
:tabc |
|
:tabo |
Close |
:tabs |
List all |
:tabr |
Go to fi |
:tabl |
Go to |
:tabm 0 |
0 |
:tabn |
Go to |
:tabp |
Go to |
Normal mode
| Shortcut | Description |
|---|---|
gt |
Go to |
gT |
Go to |
2gt |
Go to tab number 2 |