Vim / Neovim Buffers, Windows, and Tabs

Manage multiple files and layouts with buffers, splits, and tab pages.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Buffers

Open, switch, inspect, and delete buffers cleanly.

Open a file

Edit a file in the current window.

vimANYvimbuffersfiles
vim
:edit path/to/file
Notes

Often abbreviated as `:e`.

Move between buffers

Cycle through loaded buffers.

vimANYvimbuffersnavigation
vim
:bnext  :bprevious
Notes

Also abbreviated as `:bn` and `:bp`.

List buffers

Show all listed buffers.

vimANYvimbufferslist
vim
:buffers
Notes

Useful before jumping or cleaning up open files.

Delete a buffer

Unload a buffer you no longer need.

vimANYvimbufferscleanup
vim
:bdelete
Notes

Often shortened to `:bd`.

Windows and splits

Use multiple visible views in one tab page.

Horizontal split

Split the current window horizontally.

vimANYvimwindowssplits
vim
:split
Notes

Abbreviation: `:sp`.

Vertical split

Split the current window vertically.

vimANYvimwindowssplits
vim
:vsplit
Notes

Abbreviation: `:vsp`.

Move between windows

Navigate split panes from normal mode.

vimANYvimwindowsnavigation
vim
<C-w>h  <C-w>j  <C-w>k  <C-w>l
Notes

This is the core split-navigation pattern in Vim and Neovim.

Close or maximize a window

Close a split or keep only the current one.

vimANYvimwindowslayout
vim
:close  :only
Notes

Use `:only` when you want to focus on a single pane.

Tab pages

Use tabs as separate workspaces for groups of windows.

Create a new tab

Open a new tab page.

vimANYvimtabsworkspace
vim
:tabnew
Notes

Can also open a specific file in a new tab.

Switch tabs

Move forward or backward between tab pages.

vimANYvimtabsnavigation
vim
gt  gT  :tabnext  :tabprevious
Notes

Normal-mode and Ex-command tab navigation both matter in practice.

Close current tab

Remove the active tab page.

vimANYvimtabscleanup
vim
:tabclose
Notes

Handy after temporary reviews or experiments.

Recommended next

No recommendations yet.