Vim Multiple files

Tabs

Shortcut Description
:tabe [file] Edit file in a new tab
:tabf [file] Open if exists in new tab
:tabc Close current tab
:tabo Close other tabs
:tabs List all tabs
:tabr Go to first tab
:tabl Go to last tab
:tabm 0 Move to position 0
:tabn Go to next tab
:tabp Go to previous tab

#Normal mode

Shortcut Description
gt Go to next tab
gT Go to previous tab
2gt Go to tab number 2

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> = Equally high and wide
<C-w> h / l Go to the left/right window
<C-w> j / k Go to the up/down window

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
Comments