When formatting paragraphs with concealed elements, the formatting program does not take into account that some characters are invisible, and renders some lines shorter than the rest, when using the justified text option (set formatprg=par\ j
). Might there be an easy way to fix this?
1 Answer
There is no solution for that and Bram even stated, he does not consider that to be a bug. Concealing is only about the visual appearance and won't change the underlying text property. Besides being hard to get right (and possibly even slow), one would probably have many unwanted side effects, that are not wanted.
formatexpr
instead offormatprg
, and by using some Vim functions (synconcealed()
?) that allow you to somehow get access to the displayed text and pass it to theformatexpr
in order to be formated by its looks, instead of its true contents. But I'm no guru, who knows what other tricks Vim hides?<space><space><greek alpha char><space><space>
instead ofalpha