Question
Working with text and various markup languages in Vim I have recently experimented with the conceal feature to hide some of the more verbose markup. I switch conceal off when writing and editing and switch it on when searching and reading. Conceal increases readability, but it ruins paragraph formatting, which decreases readability. To benefit from conceal without losing formatting I would like to be able to format a paragraph as if the concealed markup was not there. How can I achieve this?
Context
I normally use MacVim with Vim 7.4.258.
I use par
to format my text. My 'formatprg'
is set to par -qw79
and I use gqip
and friends to apply formatting.
I have read the help topic on formatexpr
and it gave me the idea to write something in VimL that removes the concealed markup before filtering the text through formatprg
, then reapplies it to the formatted paragraph. Is this a reasonable approach? It strikes me as possible but difficult and I am hoping there is a simpler way.
Example
Here is a current example using vim-latex-1.8.23 (latex suite)
and its default concealment. There are worse cases but this will illustrate my problem. Compare the following paragraph with minor LaTeX
markup as it is appears in a buffer with conceallevel=0
Let me begin with the former idea, the modal orientation. The traditional
question that I mentioned above, i.e., Are there genuine naming devices? is
a \textit{semantical} question. Kripke's distinctive strategy is to tackle it
by attending first to a \textit{metaphysical} question. We focus on objects,
the design\textit{ata}, and their modal properties. We do not begin our
semantical investigation by looking at the design\textit{ators} and their
purely linguistic features. Not at all. The intuitive test for rigidity that
Kripke devises (N&N, 48/9) reflects this point. We start with an individual
(Nixon), and we observe that \textit{that} individual couldn't have failed to
be Nixon. Thus, the property \textit{being Nixon} applies to him necessarily
(or at least essentially, a distinction to which we shall return below).
with the same paragraph when the markup is concealed
Let me begin with the former idea, the modal orientation. The traditional
question that I mentioned above, i.e., Are there genuine naming devices? is
a semantical question. Kripke's distinctive strategy is to tackle it
by attending first to a metaphysical question. We focus on objects,
the designata, and their modal properties. We do not begin our
semantical investigation by looking at the designators and their
purely linguistic features. Not at all. The intuitive test for rigidity that
Kripke devises (N&N, 48/9) reflects this point. We start with an individual
(Nixon), and we observe that that individual couldn't have failed to
be Nixon. Thus, the property being Nixon applies to him necessarily
(or at least essentially, a distinction to which we shall return below).
par
? I mention it by way of context–it is how I currently format text. I am asking for alternatives to my current method that accommodate the discrepancy between displayed and actual line length introduced by concealing, I am not invested in any particular formatting method. Thanks for retagging (though I did not intend this question to be about syntax highlighting or external commands).