Navigating between windows
Only one window is active at a time — the one holding your cursor. To get the full power out of the windowing system, you need to get fast at zipping between windows.
Happily, it’s the same keys as moving the cursor — hjkl — prefixed with <C-w> to tell Vim “I mean windows”: <C-w>h moves left, <C-w>j down, <C-w>k up, and <C-w>l right. (The arrow keys work too, if you’re not a fan of hjkl.)
Work through the checklist: build a little window layout, then move your cursor around it. We’ll use the W map from the last step again, so the browser can’t swallow the real <C-w>.
1 2 3 4 5 6
Map W to stand in for <C-w> Fresh editor, fresh map — type :nnoremap W <C-w> and hit Enter.
Make a horizontal split Two stacked windows, cursor staying in the top one — type :split and hit Enter.
Hop to the window below with Wj Real Vim's <C-w>j drops the cursor to the lower window — press W then j.
Hop back up with Wk Real Vim's <C-w>k hops back up — press W then k.
Make a vertical split The top window will split side-by-side — type :vsplit and hit Enter.
Hop right with Wl Press W then l — real Vim's <C-w>l.
Next: Make a horizontal split
Next: Hop to the window below with Wj
Next: Hop back up with Wk
Next: Make a vertical split
Next: Hop right with Wl
Last one — goal check runs when it's done
Nice work!
Up next: Resizing windows.