How do I navigate by sentences, paragraphs, and sections in Vim?
Answer
( ) { } [[ ]]
Explanation
Vim provides structural navigation motions that move by sentences, paragraphs, and sections. These are far more efficient than line-by-line navigation for prose, documentation, and code with clear structural boundaries.
How it works
(/)— move backward/forward by sentence{/}— move backward/forward by paragraph (blank-line separated)[[/]]— move backward/forward by section (lines starting with{)[]/][— move to previous/next section end (lines starting with})
Example
Paragraph 1 first sentence. Second sentence.
Third sentence.
Paragraph 2 starts here. Another sentence.
Cursor at start:
) → moves to 'Second sentence.'
} → moves to blank line between paragraphs
}} → moves to after 'Paragraph 2'
Tips
- All of these work as motions with operators:
d}deletes a paragraph,c)changes a sentence - In code,
{and}jump between blocks separated by blank lines [[and]]are designed for C-style code where functions start with{at column 0- Combine with visual mode:
v}selects a paragraph,vi}selects inner paragraph