Re: Does 'man' syntax do its job?

2007-01-03 Thread Charles E Campbell Jr

Zvi Har'El wrote:


I tried to use view with the 'man' syntax, for example on the file vimtutor.man
obtained by

   GROFF_NO_SGR=y groff -Tascii -man $(man -w vimtutor)  vimtutor.man

(see http://www.math.technion.ac.il/~rl/etc/vimtutor.man)
(this is not the file vimtutor.man in the vim distribution - the latter
doesn't include embedded backspaces).

I have the following problem: while the character before an embedded backspace
is ignored (sort of: it is colored white), the backspace is printed as a ^H.
I would expect the two characters to be skipped all together. (snip)



Why would you expect that?  Syntax highlighting is highlighting, not 
inline folding.  Vim doesn't support inline folding.  Vince Negri has 
provided a patch to vim's source (http://vince.negri.googlepages.com/) 
which permits inline folding, though.  I've used that feature in AnsiEsc 
(http://vim.sourceforge.net/scripts/script.php?script_id=302) which 
highlights text using Ansi Escape sequences (while suppressing the 
escape sequences themselves).


However, it is unrealistic to expect that man.vim would support Negri's 
unofficial patch; in fact, there's not many scripts that do.  One 
natural use for such a feature would be to allow LaTeX files to be 
displayed using its embedded directives while suppressing the directives 
themselves, which would make for nice LaTeX editing.


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.


Regards,
Chip Campbell



RE: Does 'man' syntax do its job?

2007-01-03 Thread Vince Negri
Charles E Campbell Jr [mailto:[EMAIL PROTECTED] wrote:

 One 
 natural use for [inline folding] would be to allow LaTeX files to be 
 displayed using its embedded directives while suppressing the directives 
 themselves, which would make for nice LaTeX editing.

As shown here:

http://vince.negri.googlepages.com/concealownsyntaxforvim

;-)

Vince


Re: Does 'man' syntax do its job?

2007-01-03 Thread Charles E Campbell Jr

A.J.Mechelynck wrote:


Charles E Campbell Jr wrote:
[...]

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.


Regards,
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.


That wasn't my objection; I rather like inline folding.  Also, perhaps I 
may not have stated Bram's objection correctly, or perhaps I 
misunderstood it.After all, he does have the following note in the 
todo.txt:


-   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:


   'conceallevel'Effect
   0Text is shown normally
   1Each block of concealed text is replaced with the
   character defined in 'listchars' (default is a dash)
   and highlighted with the Conceal highlight group.
   2Concealed text is completely hidden unless it has a
   custom replacement character defined (see
   |syn-cchar|.
   3Concealed 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 
line).


Regards,
Chip Campbell