Re: Does 'man' syntax do its job?
- A.J.Mechelynck wrote:
> Charles E Campbell Jr wrote:That wasn't my objection; I rather like inline folding. Also, perhaps I
>> Unfortunately, IMHO, inline folding didn't get enough votes during
>> vim 7.0's development, and Bram is uncomfortable with the idea of
>> inline folding because it, naturally enough, suppresses information
>> (Vince's patch typically folds all lines but the current one). At
>> least, that's how I understand the state of things.
>> Chip Campbell
> Doesn't linewise folding also suppress information? Yet Vim has had
> that for quite some time. It is true that it doesn't make the folds
> disappear completely; rather, each outer closed fold is replaced by
> one line. That wouldn't work for inline folding; but maybe it could
> use the 'foldcolumn' or something to draw attention to the fact that
> something has been hidden.
> And BTW, the Hidden highlight group (guibg=bg guifg=bg) also
> "suppresses" whatever uses it, yet IIUC it is used a lot in helpfiles.
> I'm not sure about netrw, but the older Explorer plugin also used it
> to hide its sort key.
may not have stated Bram's objection correctly, or perhaps I
misunderstood it. After all, he does have the following note in the
- Add 'hidecomment' option: don't display comments in /* */ and after //.
Or is the conceal patch from Vince Negri a more generic solution?
Vince Negri's patch could certainly be used to hide comments but leave
the comment start designators visible. It basically allows one to
extend syntax highlighting to include the "conceal" option, so one can
specify things to inline conceal.
Vince's folding patch supports the notion of "conceallevel"; taken from
his patch to options.txt:
0 Text is shown normally
1 Each block of concealed text is replaced with the
character defined in 'listchars' (default is a dash)
and highlighted with the "Conceal" highlight group.
2 Concealed text is completely hidden unless it has a
custom replacement character defined (see
3 Concealed text is completely hidden.
Even conceallevel==3 isn't actually "completely hidden"; instead, the
current line (the one the cursor is on and where presumably editing may
occur) has its text shown normally (ie. no inline folding on the current
- A.J.Mechelynck [mailto:antoine.mechelynck@...] wrote:
> Doesn't linewise folding also suppress information? Yet Vim has had that forThe display depends on the setting of "concealevel". When set to 1, inline folded
> quite some time. It is true that it doesn't make the folds disappear
> completely; rather, each outer closed fold is replaced by one line. That
> wouldn't work for inline folding; but maybe it could use the 'foldcolumn' or
> something to draw attention to the fact that something has been hidden.
elements are replaced by a configurable special character. When set to 2, the
folded elements are hidden completely; your idea of showing something in
foldcolumn is an interesting one.
- James Vega [mailto:jamessan@...] wrote:
On the other hand, integrating the [conceal] patch would provide a solution for
various itches that I know people want to scratch (mainly to do with
builtin previewing of filetypes like html, tex, etc). If it were
disabled by default (as I think folding should be), it would allow
people that knew of it to take advantage of the functionality without
causing novice users to wonder what the heck is going on.
FYI the default "conceallevel" is 0, at which no concealment goes on at all.
0 - normal operation.
1 - inline folding, each group of concealed chars replaced by a configurable character
(by default this is a "-" highlighted to look similar to a folded line.
Mode 1 is most useful for "folding out" applications, since you can always
see that something has been removed.
2 - hide/replace mode. Concealed chars are hidden completely, unless a character has
been specified for them in the syntax definition. Simple example: in my own
HTML syntax I have the "&" sequence folded and replaced with "&".
Mode 2 is the most useful for "smart" TeX and HTML etc editing, as it has
the cleanest look.
3 - hide mode. Concealed chars are always hidden completely. This is only there for
completeness, I would imagine option 2 is always the more useful.