Vim File Navigation — gg, G, Ctrl+f, Ctrl+b

Navigate through entire files in Vim with page scrolling, half-page scrolling, and paragraph jumps. Master Ctrl+f, Ctrl+b, Ctrl+d, Ctrl+u, and more.

Navigation

Detailed Explanation

Scrolling Through Files

When editing large files, you need efficient ways to move through content beyond single lines:

Full Page Scrolling

Key Action
Ctrl+f Scroll forward (down) one full screen
Ctrl+b Scroll backward (up) one full screen

Half Page Scrolling

Key Action
Ctrl+d Scroll down half a screen
Ctrl+u Scroll up half a screen

Half-page scrolling is often preferred because it provides context continuity — you can still see some of the previous view.

Paragraph and Block Movement

Key Action
{ Jump to the previous blank line (paragraph start)
} Jump to the next blank line (paragraph end)

In code, this jumps between function definitions or logical blocks separated by blank lines.

Screen-Relative Positioning

Key Action
H Move cursor to the top of the visible screen
M Move cursor to the middle of the visible screen
L Move cursor to the bottom of the visible screen

Scroll Without Moving Cursor

Key Action
zz Center the current line on screen
zt Scroll so current line is at the top
zb Scroll so current line is at the bottom

These are invaluable when you want to see more context around your current editing position.

Use Case

You are working with large files and need to quickly scroll through content, jump between sections, or reposition the view without losing your cursor position.

Try It — Vim Cheat Sheet

Open full tool