Vim understands the concept of a "paragraph". Vim's definition of a paragraph is a block of text surrounded by blank lines*. There are several motions and text objects to work with this.
[count]}
– Move [count]
paragraphs forward. You can use <S-v>}
to select all lines from the current line to the next blank line. This will include the blank line, so you may want to use <S-v>}k
.
[count]ip
– Select [count]
paragraphs. It's like iw
(inner word) except for, well, paragraphs. Using vip
will select all of the paragraph though, rather than from the current line to the end of the paragraph.
[count]ap
– like ip
, except that this will include the blank lines surrounding the paragraph.
One caveat here is that Vim doesn't consider a line with only whitespace as a "blank line". So make sure to check this (e.g. with :set list
) if it doesn't appear to work.
Also remember you can always search for the pattern you want. You can get an empty line with /^$
; or if you don't want to select the empty line itself you can use \n\n
to put the cursor at the end of the line before the first blank line:
<S-v>/^$<CR>
<S-v>/\n\n<CR>
* There are some exceptions, see :help paragraph
for the full logic. But for most intents and purposes this definition works fine.