Navigate a long wrapped paragraph
gj or gk
Example
Normal mode with wrap enabled. One file line spans three screen rows. Cursor on the first row.
Before
File line 1 wraps onto three screen rows.
Cursor: first screen row of file line 1
- gj Next screen row · same file line
- gk Previous screen row · same file line
After
After gj: second screen row of file line 1
After gk: first screen row of file line 1
Details & Vim help
Move down or up by display lines instead of file lines.
Stay within a long wrapped line while reading prose.
j and k move file lines. gj and gk are characterwise motions with operators, so do not assume they behave like linewise j or k deletions.
Screen rows depend on window width. gj and gk move between those rows instead of whole file lines.
Try it in Vim
- Enable wrapping with :set wrap if needed.
- Use gj to go down one displayed row.
- Use gk to go back up a displayed row.