15

Are there built-in commands in VIM that navigate to the next/previous blank lines?

4
  • 14
    { and } is what you want. Commented Sep 25, 2015 at 15:51
  • ^ above comment more to the point for the question. Commented Feb 5, 2017 at 9:58
  • 1
    if you find they aren't stopping on what looks like blank lines its probably because they have whitespace on them. You can remove using substitute like this: :%s/^\s\+$// Commented Apr 13, 2018 at 14:10
  • 1
    Try adding set list if { doesn't work for you Commented Jan 25, 2022 at 14:18

2 Answers 2

15

Next blank line use (right curly bracket):

}

Previous blank line use (left curly bracket):

{

Type the above when in command mode

12

Going to the help on navigation (:h navigation):

Cursor motions                                  cursor-motions navigation

These commands move the cursor position.  If the new position is off of the
screen, the screen is scrolled to show the cursor (see also 'scrolljump' and
'scrolloff' options).

1. Motions and operators        operator
2. Left-right motions           left-right-motions
3. Up-down motions              up-down-motions
4. Word motions                 word-motions
5. Text object motions          object-motions
6. Text object selection        object-select
7. Marks                        mark-motions
8. Jumps                        jump-motions
9. Various motions              various-motions

Text object motions seem to be the most likely candidate (or would Jumps?). Move to object-motions and press <c-]> (Ctrl ]):

5. Text object motions                                  object-motions

                                                        (
(                       [count] sentences backward.  exclusive motion.

                                                        )
)                       [count] sentences forward.  exclusive motion.

                                                        {
{                       [count] paragraphs backward.  exclusive motion

                                                        }
}                       [count] paragraphs forward.  exclusive motion.

Bingo!

1
  • The Vim help text system (:help) is one of the best pieces of online (as in "inside-the-program") software documentation that I have come across. Commented Apr 13, 2018 at 5:52

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.