Paragraphs are delimited by empty lines, both in vim and tex, but sometimes I wish vim to treat an entity as a paragraph and not tex. Can I, e.g., make vim treat lines containing only a "%" as a paragraph delimiter?
1 Answer
You cannot natively make %
a pagraph delimiter, as paragraph macros are nroff macros (a dot, two characters: .xx
)
However, you can add .%%
(or any other combination you want) as a paragraph delimiter by adding it do the paragraphs
option:
:set paragraphs=IPLPPPQPP\ TPHPLIPpLpItpplpipbp%%
See: :help 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. The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds to
the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in
the first column). A section boundary is also a paragraph boundary.
Note that a blank line (only containing white space) is NOT a paragraph
boundary.
Also note that this does not include a '{' or '}' in the first column. When
the '{' flag is in 'cpoptions' then '{' in the first column is used as a
paragraph boundary posix.
Error detected while processing /Users/lawrence/.vim/plugged/Improved-paragraph-motion/plugin/ipmotion.vim: line 50: E492: Not an editor command: ^M line 51: E15: Invalid expression: exists('g:loaded_ipmotion')^M line 145: E171: Missing :endif
:set ff=unix
.