7

Suppose I have the following piece of code through which I would like to navigate

===>Cursor is here and when I press {
    SomeTest
    {
       line1
       line2
       line3

       line4
            =====>it ends up here
       line 5
    }
   ====>Cursor should end up here

I would like the cursor which is on top of SomeTest statement to go at the end of the code paragraph. Normally I would use { and } to skip to the next paragraph. However the presence of blank lines before line4 and line 5 make this technique fail.

Why does having a single blank line above and below line 4 move the cursor there. What can I do to fix this ? What does Vim consider a paragraph ? I know I could use ]}to go the ending or beginning if I am inside the function. What I would like to do is jump through the function from top to the bottom and not going inside the function?

1 Answer 1

9

You may want to move to the next section:

]]

Documentation:

:h paragraph
A paragraph begins after each empty line, and also at each of a set of
paragraph macros, specified by the pairs of characters in the 'paragraphs' option. 

:h section
A section begins after a form-feed (<C-L>) in the first column and at each of
a set of section macros, specified by the pairs of characters in the
'sections' option.  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.