Combining vim's fold and conceal feature -


i'm using vim's conceal feature display latex files in more readable form.

furthermore, i'm using vim-latex plugin, creates folds math environments show label , beginning of content of environment.

example: math environment in plain latex code looks this:

\begin{align}    \xi = \cos \alpha    \label{eqn:test} \end{align} 

using vim's conceal feature, displayed as

\begin{align}    ξ = \cos α    \label{eqn:test} \end{align} 

when vim creates fold, displays as

+--  4 lines: align (eqn:test): \xi = \cos \alpha 

my question now: possible vim apply conceal description of folds, looks below?

+--  4 lines: align (eqn:test): ξ = \cos α 

in general, foldtext , conceal could combined. needs implemented yourself, following conceal logic.

the option foldtext defines text display, when fold closed. value of option vim function or expression. pretty modification on original text.

conceal. does: when x pattern matched, display y instead of x. write function, read foldstart line, check conceal syntax patterns, if line matches any, if true, remove matched part, , display cchar. set function value of foldtext option. of course file type.

for highlighting, these 2 groups used foldtext.

folded      line used closed folds foldcolumn  'foldcolumn' 

it can think of. if have better/easier way it, glad learn. example build-in function, don't know, in situation.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -