Windows & Tabs in Vim
From the Vim cheat sheet · Files & Buffers · verified Jul 2026
Windows & Tabs
Managing multiple windows and tabs
text
:sp or :split - Split window horizontally
:vsp or :vsplit - Split window vertically
:sp filename - Open file in horizontal split
:vsp filename - Open file in vertical split
Ctrl+w s - Split horizontally
Ctrl+w v - Split vertically
Ctrl+w w - Switch windows
Ctrl+w h/j/k/l - Navigate to window
Ctrl+w H/J/K/L - Move window
Ctrl+w = - Equal size windows
Ctrl+w _ - Maximize height
Ctrl+w | - Maximize width
Ctrl+w + - Increase height
Ctrl+w - - Decrease height
Ctrl+w > - Increase width
Ctrl+w < - Decrease width
Ctrl+w c - Close window
Ctrl+w o - Close all other windows
:tabnew - New tab
:tabnew filename - Open file in new tab
gt - Go to next tab
gT - Go to previous tab
:tabclose - Close tab
:tabs - List tabs💡 Use splits for comparing files side by side
⚡ Ctrl+w then hjkl to navigate windows
📌 :vsp for vertical split is most common
🟢 gt/gT for tab navigation
windowstabssplits