level 09
File & Buffer Navigation
Move between files and buffers, save, and quit.
Real work spans files, not one. Vim doesn’t think in tabs the way most editors do; it thinks in buffers, and the distinction trips people up for about a day before it clicks and never bothers them again. Get the model straight and hopping across a codebase stops being a chore.
Buffers, Windows, Tabs
- A buffer is an open file (it stays in memory even when not visible).
- A window is a viewport onto a buffer.
- A tab is a layout of windows.
:bnext :bprev → cycle buffers
Ctrl+^ → toggle the two most recent buffers
:ls → list open buffers
:b {name} → jump to a buffer by name
Splits
:sp :vsp → horizontal / vertical split
Ctrl+w h/j/k/l → move between windows
Ctrl+w w → cycle windows
Ctrl+w q → close the current window
Saving & Quitting
:w :q :wq :q! → save, quit, save+quit, quit without saving
ZZ ZQ → save+quit / quit shortcuts
Buffers, splits, and
:w/:qneed a real Vim session with multiple files, so they can’t run in the single embedded editor below. Most Vim and Neovim users also add a fuzzy finder — fzf.vim or Telescope.nvim — to jump to files by name instantly. The exercise here practices the in-file navigation that makes moving within a buffer just as fast.
Fast in-file navigation
- Press
Gto jump to the last line, thenggto return to the top. - Press
4Gto jump toAPI_KEY, thenzzto center it. - Search
/TIMEOUTand Enter to jump straight to that constant. - Put the cursor on
DB_HOSTand press*to find its other uses.
goal Reach any line quickly with gg, G, counts, and centering.
Edit, then keep moving
- Jump to the
listenline with/listenand Enter. - Change the port from
3000to8080withciw. - Press
ggto return to the top. - On the
app.useline, pressoto open a line below and addapp.use(logger);.
goal Combine navigation with edits — the everyday rhythm.