I'm trying set up text inside default fold markers to be treated as a distinct paragraph. To see, in a new buffer:
:set foldmethod=marker
This is a paragraph 1
{{{
Want text inside this fold treated as a paragraph 2 (as well as the surrounding markers)
}}}
Finally, this would be paragraph 3
Currently vip
on any line will select all lines. Desired outcome for vip
depending on cursor line:
- line 1: selects text on line 1 only
- line 2-4: selects text of lines 2-4
- line 5: selects text on line 5 only.
One solution is to add empty lines around any folds, but that is specifically what I am trying to avoid in this case.
I have experimented with adjusting :set paragraphs
but have not found anything yet that has worked. I also tried set cpo+={
which helps with {
motion operator, but not paragraph text object.
.{{
/.}}
and:set paragraphs^={{}}
, though I don't how likevip
behaves in the middle there. Or, mess with[[
and][
to jump between braces. Or, well, add newlines :)gqip
on line5 to merge with line 4. but it appears lines with .nroff macros are not touched bygqip
(despite being visually selected withvip
).gqip
commands work in all three paragraphs,vip
command on the bottom line selects the line above it. I tried putting placing nroff paragraph macro on lines 2 and 2 and 5. This works for bothvip
andgqip
exceptgqip
does not format a line that starts with an nroff macro. I also triedset fo+=w
so that lines without a trailing whitespace count as end of paragraph, but that does not appear to work withvip
motion operators.