Re: Folding between #ifdef _DEBUG and #endif

2006-10-10 Thread panshizhu
[EMAIL PROTECTED] 写于 2006-10-11 12:27:33:
> > :FoldMatching #ifdef\ _DEBUG #endif 0
> >
> > The last parameter is a context, so you might like 1 better than 0
> > (allows you to see what you are folding). Alternatively, you can also
> > configure the foldtext (see plugin page or the header in the file for
> > information)
> >
> > If you want this to be automatically done everytime you open the file,
> > then you need to create an autocommand e.g.,(untested):
> >
> > au FileType c FoldMatching #ifdef\ _DEBUG #endif 0
> Hari,
>
> Perfect. That's exactly what I wanted, and I'm sure your script will
> be useful in many other ways as well Good to find out about it, and
> thanks for your work.
>
> --
> Kamil Kisiel <[EMAIL PROTECTED]>

I don't know how it works, but it seems that cannot cope with statements
like the following:

#ifdef _DEBUG
/* only things here should be folded */
#else
   /* these lines should NOT be folded */
#endif

or the following:

#ifndef _DEBUG
/* these lines should NOT be folded */
#else
/* only things here should be folded */
#endif

What should I do, if the #if statements may contain #else? especially for
the latter one, the #ifndef has #else?

--
Sincerely, Pan, Shi Zhu. ext: 2606



Re: Problem in dos runtime on Vim FTP

2006-10-10 Thread A.J.Mechelynck

Bill McCarthy wrote:

On Tue 10-Oct-06 9:26pm -0600, A.J.Mechelynck wrote:



Bill McCarthy wrote:

Hello Vim List,

Since yesterday, 4 files in the dos/autoload directory
cannot be downloaded - it doesn't appear to matter which FTP
client is used.

The four problem files are:

netrw.vim
tar.vim
vimball.vim
zip.vim

The URL for the directory of these files is:

ftp://ftp.home.vim.org/pub/vim/runtime/dos/autoload


Those files have been recently updated. If your download problem isn't yet
fixed by now, try the corresponding files in 
ftp://ftp.vim.org/pub/vim/runtime/autoload/ . They will have LF-only ends-of

files (which makes them slightly shorter and not Notepad-compatible) but Vim
should have no problem using them (if your 'fileformats' includes "unix",
which is the default).


I copied the that directory to an empty local directory.
The copy worked fine except for 4 files - the ones mentioned
above.  The files that did copy had unix CRs.



We-e-ell, that's strange. Something must have gone wrong on the FTP servers.

I updated my runtime files a few hours ago from the rsync server; but from a 
"long" directory listing, I notice that the four files above (which are dated 
14-Aug-2006) plus netrwSettings.vim (dated 9-Oct-2006) have permissions 
-rwr-- : i.e., they are apparently readable by everyone except members of 
the owning group (which is a weird set of permissions). I guess the maintainer 
of the files, or the owner of the servers, should run "chmod 644" on them. 
(IIUC, the maintainer of all those files is Dr. Chip so I add him on the Cc: 
list.)


If you have a version of rsync you may try using that: it worked for me. The 
command I use (which was mentioned in a recent post in a different thread, and 
which I repeat here) is


  cd ~/.build/vim/vim70
  rsync -avzcP --delete --exclude="/dos/" ftp.nluug.nl::Vim/runtime/ ./runtime

I suppose a trivial modification would be enough to make it fit your setup. On 
my system, the above lists files deleted or downloaded. "rsync --version" gives:


rsync  version 2.6.3  protocol version 28
Copyright (C) 1996-2004 by Andrew Tridgell and others

Capabilities: 64-bit files, socketpairs, hard links, acls, symlinks, batchfiles,
  inplace, IPv6, 64-bit system inums, 64-bit internal inums, SLP

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.



Best regards,
Tony.


Re: Problem in dos runtime on Vim FTP

2006-10-10 Thread Bill McCarthy
On Tue 10-Oct-06 9:26pm -0600, A.J.Mechelynck wrote:


> Bill McCarthy wrote:
>> Hello Vim List,
>> 
>> Since yesterday, 4 files in the dos/autoload directory
>> cannot be downloaded - it doesn't appear to matter which FTP
>> client is used.
>> 
>> The four problem files are:
>> 
>> netrw.vim
>> tar.vim
>> vimball.vim
>> zip.vim
>> 
>> The URL for the directory of these files is:
>> 
>> ftp://ftp.home.vim.org/pub/vim/runtime/dos/autoload
>> 
>
> Those files have been recently updated. If your download problem isn't yet
> fixed by now, try the corresponding files in 
> ftp://ftp.vim.org/pub/vim/runtime/autoload/ . They will have LF-only ends-of
> files (which makes them slightly shorter and not Notepad-compatible) but Vim
> should have no problem using them (if your 'fileformats' includes "unix",
> which is the default).

I copied the that directory to an empty local directory.
The copy worked fine except for 4 files - the ones mentioned
above.  The files that did copy had unix CRs.

-- 
Best regards,
Bill



Re: Folding between #ifdef _DEBUG and #endif

2006-10-10 Thread Kamil Kisiel

On 10/11/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:


On Tue, 10 Oct 2006 at 12:14pm, Kamil Kisiel wrote:

> I've got some C++ source code that I'd like to fold away. Basically I
> want vim to have folds only between #ifdef _DEBUG and the
> corresponding #endif statement, and nowhere else. My vimfu is a bit
> weak in this respect so I'm not quite sure how I would go about doing
> this. Using foldexpr, changing the marker type? Previously I was just
> manually creating folds, but as you can imagine it gets fairly tedious
> and it would be great if I could automate it. Your help is much
> appreciated.

If the ifdefs that you want to fold are not nested, you can use my
foldutil plugin from here:

http://www.vim.org/scripts/script.php?script_id=158

You would use something like:

:FoldMatching #ifdef\ _DEBUG #endif 0

The last parameter is a context, so you might like 1 better than 0
(allows you to see what you are folding). Alternatively, you can also
configure the foldtext (see plugin page or the header in the file for
information)

If you want this to be automatically done everytime you open the file,
then you need to create an autocommand e.g.,(untested):

au FileType c FoldMatching #ifdef\ _DEBUG #endif 0



Hari,

Perfect. That's exactly what I wanted, and I'm sure your script will
be useful in many other ways as well Good to find out about it, and
thanks for your work.

--
Kamil Kisiel <[EMAIL PROTECTED]>


Re: vim7: uninstalling vimball installed scripts

2006-10-10 Thread A.J.Mechelynck

David Thompson wrote:

How does one uninstall the various pieces installed
via a vimball?


see ":help vimball-rmvimball"


Best regards,
Tony.


vim7: uninstalling vimball installed scripts

2006-10-10 Thread David Thompson
How does one uninstall the various pieces installed
via a vimball?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: Problem in dos runtime on Vim FTP

2006-10-10 Thread A.J.Mechelynck

Bill McCarthy wrote:

Hello Vim List,

Since yesterday, 4 files in the dos/autoload directory
cannot be downloaded - it doesn't appear to matter which FTP
client is used.

The four problem files are:

netrw.vim
tar.vim
vimball.vim
zip.vim

The URL for the directory of these files is:

ftp://ftp.home.vim.org/pub/vim/runtime/dos/autoload



Those files have been recently updated. If your download problem isn't yet 
fixed by now, try the corresponding files in 
ftp://ftp.vim.org/pub/vim/runtime/autoload/ . They will have LF-only ends-of 
files (which makes them slightly shorter and not Notepad-compatible) but Vim 
should have no problem using them (if your 'fileformats' includes "unix", 
which is the default).



Best regards,
Tony.


Problem in dos runtime on Vim FTP

2006-10-10 Thread Bill McCarthy
Hello Vim List,

Since yesterday, 4 files in the dos/autoload directory
cannot be downloaded - it doesn't appear to matter which FTP
client is used.

The four problem files are:

netrw.vim
tar.vim
vimball.vim
zip.vim

The URL for the directory of these files is:

ftp://ftp.home.vim.org/pub/vim/runtime/dos/autoload

-- 
Best regards,
Bill



Re: Shading alternating patterns.

2006-10-10 Thread A.J.Mechelynck

Peter Hodge wrote:

Hello Aaron,

You could do something like this:

  syn match Sel1 /^\.selector/ nextgroup=Items1 skipwhite
  syn region Items1 start=/{/ end=/}/ contained keepend
\ nextgroup=Sel2 skipwhite skipempty

  hi Sel1 guibg=#44
  hi Items1 guibg=#44

  syn match Sel2 /^\.selector/ contained nextgroup=Items2 skipwhite
  syn region Items2 start=/{/ end=/}/ contained keepend

  hi Sel2 guibg=#004400
  hi Items2 guibg=#004400

That will get you started.

regards,
Peter



Black on dark blue, or black on dark green, won't be very visible. I'm 
throwing no bird names around though; if Aaron doesn't like the colours, he 
can change them.


See also ":help :hi-default": Highlight colours defined in a syntax script 
should have the "default" keyword, otherwise they will override anything a 
colorscheme might already have set for those same groups.



Best regards,
Tony.


Re: Shading alternating patterns.

2006-10-10 Thread Peter Hodge
Hello Aaron,

You could do something like this:

  syn match Sel1 /^\.selector/ nextgroup=Items1 skipwhite
  syn region Items1 start=/{/ end=/}/ contained keepend
\ nextgroup=Sel2 skipwhite skipempty

  hi Sel1 guibg=#44
  hi Items1 guibg=#44

  syn match Sel2 /^\.selector/ contained nextgroup=Items2 skipwhite
  syn region Items2 start=/{/ end=/}/ contained keepend

  hi Sel2 guibg=#004400
  hi Items2 guibg=#004400

That will get you started.

regards,
Peter


--- Aaron <[EMAIL PROTECTED]> wrote:

> I've been swapping my subscribed addresses, so I apologize if this got 
> posted more than once.
> 
> My question is casual, but I wasn't able to find anything on the FAQs or
> Google, so I hope someone here can tell me if I'm nuts or not.
> 
> In my ideal world (which, so far, Vim has done an excellent job creating
> for me), CSS definitions would be lightly, alternatingly shaded. Here at
> work, we format our CSS files like so:
> 
> .selector { property: value; property: value;
> property: value; }
> .selector { property: value; }
> .selector { property: value; property: value;
> property: value; property: value; }
>
> 
> You can see immediately that it is easy enough to scan down the left
> column to find the selector you're interested in, but it's a bit more
> difficult to see where one definition's property list starts and
> another's ends (especially with syntax highlighting in there).
> 
> Is there some way, perhaps through a syntax rule, or rules, to have Vim
> shade the background of *alternating* CSS definitions, assuming this
> file format?
> 
> I'm handy with regex but I don't know if Vim's syntax system is even up
> to the task. A function that ran against the buffer would be fine, too.
> 
> Thanks!
> 
> -- 
> Aaron
> 




 
On Yahoo!7 
Photos: Unlimited free storage – keep all your photos in one place! 
http://au.photos.yahoo.com 



Re: vim | editing pdf files with vim

2006-10-10 Thread Mikolaj Machowski
Dnia wtorek, 10 października 2006 15:58, Nikolaos A. Patsopoulos napisał:
> Hi all,
>
> is there a way to edit pdf files with vim? If not pdf as is, then eps or
> postscript? I tried with either format but the text kept been converted
> to sthl ike ASCII code.
Try pdftk and vim plugin for that program (sorry, don't remember site
address). But this is only for correcting singular typos or compatible,
nothing more.

m.



Re: bugs in vim scripting highlighting

2006-10-10 Thread Hari Krishna Dara

On Tue, 10 Oct 2006 at 3:29pm, Charles E Campbell Jr wrote:

> Problem 1 has been addressed in the latest syntax/vim.vim -- please try
> it out.
> I think problem 2 was addressed previously.
>
> syntax/vim.vim is now up to v7.0-55, and you can get it from
>
>   http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
>
> You can then select vim.vim syntax.
>
> Regards,
> Chip Campbell
>

I faced a problem, though it is with netrw, not with vim syntax file. I
tried to open the download link from Vim, and got the below error:

Error detected while processing function netrw#NetRead:
line  275:
"http://mysite.verizon.net/astronaut/vim/syntax/vim.vim.gz"; E212: Can't open
file for writing
"VIG3A4.tmp.gz" [+][Not edited] --No lines in buffer--
Error detected while processing function netrw#NetRead..115_NetGetFile:
line   42:
E37: No write since last change (add ! to override)
"http://mysite.verizon.net/astronaut/vim/syntax/vim.vim.gz"; [+][Not edited]
--No lines in buffer--
Error detected while processing function gzip#read:
line   31:
Error: Could not read uncompressed file
"VIJ3A7.tmp.gz" [Not edited] --No lines in buffer--

I got an empty buffer, and when I reloaded the buffer, it worked fine. I
am on windows.

VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 10 2006 20:44:39)
MS-Windows 32 bit GUI version with OLE support
Included patches: 1-99
Compiled by [EMAIL PROTECTED]
Huge version with GUI.  Features included (+) or not (-):

-- 
Thanks,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: vim | editing pdf files with vim

2006-10-10 Thread Yakov Lerner

On 10/10/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote:

is there a way to edit pdf files with vim? If not pdf as is, then eps or
postscript? I tried with either format but the text kept been converted
to sthl ike ASCII code.


Try to find pdf-to-word  conversion tool (openoffice can edit
word files), or pdf-to-rtf conversion tool. Then you edit word file or rtf
fle, then openoffice can export file into pdf format back again.

Yakov


Re: bugs in vim scripting highlighting

2006-10-10 Thread Charles E Campbell Jr

Mikolaj Machowski wrote:


Noticed two bugs in vim script highlighting:

1. xnoremap and snoremap are not fully recognized. Compare highlighting
  of those three lines:

 inoremap CtrlC()
 xnoremap CtrlC()
 snoremap CtrlC()

  Arguments of xnoremap and snoremap aren't highlighted

2. Function element addButton is highlighted as error:

   function! forms#form.addButton(fname, flabel, fvalue, hotkey, listener)

  But it works (as in forms.vim). the same apply to call call.
 



Problem 1 has been addressed in the latest syntax/vim.vim -- please try 
it out.

I think problem 2 was addressed previously.

syntax/vim.vim is now up to v7.0-55, and you can get it from

 http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax

You can then select vim.vim syntax.

Regards,
Chip Campbell



Re: Folding between #ifdef _DEBUG and #endif

2006-10-10 Thread Hari Krishna Dara

On Tue, 10 Oct 2006 at 12:14pm, Kamil Kisiel wrote:

> I've got some C++ source code that I'd like to fold away. Basically I
> want vim to have folds only between #ifdef _DEBUG and the
> corresponding #endif statement, and nowhere else. My vimfu is a bit
> weak in this respect so I'm not quite sure how I would go about doing
> this. Using foldexpr, changing the marker type? Previously I was just
> manually creating folds, but as you can imagine it gets fairly tedious
> and it would be great if I could automate it. Your help is much
> appreciated.

If the ifdefs that you want to fold are not nested, you can use my
foldutil plugin from here:

http://www.vim.org/scripts/script.php?script_id=158

You would use something like:

:FoldMatching #ifdef\ _DEBUG #endif 0

The last parameter is a context, so you might like 1 better than 0
(allows you to see what you are folding). Alternatively, you can also
configure the foldtext (see plugin page or the header in the file for
information)

If you want this to be automatically done everytime you open the file,
then you need to create an autocommand e.g.,(untested):

au FileType c FoldMatching #ifdef\ _DEBUG #endif 0

-- 
HTH,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: vim | editing pdf files with vim

2006-10-10 Thread Charles E Campbell Jr

Nikolaos A. Patsopoulos wrote:,

is there a way to edit pdf files with vim? If not pdf as is, then eps 
or postscript? I tried with either format but the text kept been 
converted to sthl ike ASCII code.


For purposes of visualization, using netrw's browser and, with the 
cursor on the pdf file, pressing "x" will (usually) bring up a tool to 
visualize the pdf file.  For editing (as in changing file contents), I'm 
afraid I don't know.


Regards,
Chip Campbell



Re: vim | editing pdf files with vim

2006-10-10 Thread Alan Young
Nikolaos A. Patsopoulos wrote:
> is there a way to edit pdf files with vim? If not pdf as is, then eps or
> postscript? I tried with either format but the text kept been converted
> to sthl ike ASCII code.

Woops ... just found this by accident:

http://www.pdfhacks.com/pdftk/#vim_plugin

>From the description: "Vim users can also install my plug-in for easily
editing PDF code. When you open a PDF in Vim, the plug-in calls pdftk to
uncompress the page streams, so they are editable. When you save the
PDF, the plug-in uses pdftk to repair and re-compress the PDF."

Don't know how well it works.


Re: vim | editing pdf files with vim

2006-10-10 Thread Alan Young
Nikolaos A. Patsopoulos wrote:
> is there a way to edit pdf files with vim? If not pdf as is, then eps or
> postscript? I tried with either format but the text kept been converted
> to sthl ike ASCII code.

Not really.  But you can use a program called pdftk that will help you
along those lines.

http://www.accesspdf.com/pdftk/


Re: vim | editing pdf files with vim

2006-10-10 Thread A.J.Mechelynck

Nikolaos A. Patsopoulos wrote:

Hi all,

is there a way to edit pdf files with vim? If not pdf as is, then eps or 
postscript? I tried with either format but the text kept been converted 
to sthl ike ASCII code.


Thanks,

Nikos




Vim is a text editor. PDF files contain both text data and binary data. I 
woudn't try editing them with Vim: too much risk of f...ouling it all up by 
not knowing what I'm doing.


If you want to see what PDF looks like when printed, use Acrobat Reader. If 
you want to edit it, I guess you'll have to buy some PDF editor from Adobe.


PostScript can, IIUC, be viewed in Vim, and even with syntax highlighting -- 
but as PostScript code, not as WYSIWYG rendered text. That's great if you want 
to "program" in PostScript.



Best regards,
Tony.


RE: vim | editing pdf files with vim

2006-10-10 Thread Max Dyckhoff
PDF files need to be edited with a specific editor, because they contain 
non-human readable structure and encodings. Your request is similar to asking 
if you could edit a JPEG with vim.

If it is just a PDF of a text file then you should simply be able to copy/paste 
the text into your favourite text editor (vim!), and edit it there, but if you 
want to edit the PDF file then you will need to search for a PDF editor. I 
don't know of any off-hand, but I'm sure a quick Google search will turn one up.

Max


> -Original Message-
> From: Nikolaos A. Patsopoulos [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 10, 2006 9:20 AM
> To: [EMAIL PROTECTED]; vim@vim.org
> Subject: Re: vim | editing pdf files with vim
>
> Mike Williams wrote:
> > Nikolaos A. Patsopoulos did utter on 10/10/2006 14:58:
> >> Hi all,
> >>
> >> is there a way to edit pdf files with vim? If not pdf as is, then eps
> >> or postscript? I tried with either format but the text kept been
> >> converted to sthl ike ASCII code.
> >
> > In general trying to edit PDF or PostScript files is a non-starter,
> > unless you have a lot of knowledge about how the files were
> > constructed.  In particular, text depends on the font encoding used.
> > It will be much easier to go back to the original application that
> > generated the PDF/PS and edit the document there.
> >
> > TTFN
> >
> > Mike
> You are 100% right. But what if you cannot access the original file?
> Lets say you want to edit a pdf you downloaded from internet. Isn't
> there a way to do this with vim? I haven't tried emacs or sed but
> probably they will fail too. I was just wondering if there some way out
> there.
>
>
> Nikos



Re: vim | editing pdf files with vim

2006-10-10 Thread Nikolaos A. Patsopoulos

Mike Williams wrote:

Nikolaos A. Patsopoulos did utter on 10/10/2006 14:58:

Hi all,

is there a way to edit pdf files with vim? If not pdf as is, then eps 
or postscript? I tried with either format but the text kept been 
converted to sthl ike ASCII code.


In general trying to edit PDF or PostScript files is a non-starter, 
unless you have a lot of knowledge about how the files were 
constructed.  In particular, text depends on the font encoding used.  
It will be much easier to go back to the original application that 
generated the PDF/PS and edit the document there.


TTFN

Mike
You are 100% right. But what if you cannot access the original file? 
Lets say you want to edit a pdf you downloaded from internet. Isn't 
there a way to do this with vim? I haven't tried emacs or sed but 
probably they will fail too. I was just wondering if there some way out 
there.



Nikos



Re: vim | editing pdf files with vim

2006-10-10 Thread Mike Williams

Nikolaos A. Patsopoulos did utter on 10/10/2006 14:58:

Hi all,

is there a way to edit pdf files with vim? If not pdf as is, then eps or 
postscript? I tried with either format but the text kept been converted 
to sthl ike ASCII code.


In general trying to edit PDF or PostScript files is a non-starter, 
unless you have a lot of knowledge about how the files were constructed. 
 In particular, text depends on the font encoding used.  It will be 
much easier to go back to the original application that generated the 
PDF/PS and edit the document there.


TTFN

Mike
--
Free the bound periodicals!


Re: Setting up netrw

2006-10-10 Thread Charles E Campbell Jr

Suresh Govindachar wrote:


 The version of netrw in the vim sources, on vim.org and on your
 web-site all differ. Since netrw is part of the vim runtime-
 sources, could you please coordinate your releases with Bram?
 



They are already quite coordinated.  Development version appears at my 
website,
an interim release appears at vim.sf.net, and the interim release is 
also sent on to Bram.



 Also, there is a note on your web-site about needing to update
 vimball. Is vimball part of vim runtime-sources?
 



Yes, although it, too, undergoes the same development process.


 If you would prefer people use netrw under vimfiles/ rather than
 under the main vim directory, please have Bram remove netrw from
 the runtime-distribution.
 

I have no such preference.  However, the runtime-distribution release 
will interfere with
the development release.  This problem will be addressed whenever the 
next vim 7.1 appears.


If you don't wish to use the development version of netrw (or vimball), 
then feel free not to.





Re: Shading alternating patterns.

2006-10-10 Thread Aaron

Tim Chase wrote:
>  > Is there some way, perhaps through a syntax rule, or
>  > rules, to have Vim shade the background of *alternating*
>  > CSS definitions, assuming this file format?
>
> While I'm not sure the below will solve it, I've pasted in
> some dialog from Benji Fisher and Tony Mechelynck (from back
> in February of this year, which I saved as I thought it was
> a nifty stunt) regarding the highlighting of alternate
> *lines*.  One might be able to use this as a foundation for
> doing alternate CSS-rule-blocks:
>
> BF>> I have not used syntax much either, but I decided to test
> BF>> this.  I think what you want is (two :hi lines and)
> BF>> something like this:
> BF>>
> BF>> :syn match Oddlines "^.*$" contains=ALL nextgroup=Evenlines skipnl
> BF>> :syn match Evenlines "^.*$" contains=ALL nextgroup=Oddlines skipnl
> BF>>
> BF>> In other words, drop "transparent" and add "skipnl".  I
> BF>> tested it with
> BF>>
> BF>> :syn clear
> BF>>
> BF>> first; I am not sure how well it will work without that.
> AM>
> AM> I agree about "skipnl".
> AM>
> AM> Got it to work on text files, as follows (on W32)
> AM>
> AM>  ~/vimfiles/after/syntax/text.vim
> AM> hi default Oddlines ctermbg=grey guibg=#808080
> AM> hi default Evenlines cterm=NONE gui=NONE
> AM>
> AM> syn match Oddlines "^.*$" contains=ALL nextgroup=Evenlines skipnl
> AM> syn match Evenlines "^.*$" contains=ALL nextgroup=Oddlines skipnl
> AM>
> AM>  $VIM/vimfiles/after/filetype.vim
> AM> augroup filetypedetect
> AM> au BufRead,BufNewFile *.txt setf text
> AM> augroup END
> AM>
> AM>  ~/vimfiles/colors/almost-default.vim
> AM> [...]
> AM> hi Oddlines ctermbg=yellow guibg=#99
> AM> hi Evenlines ctermbg=magenta guibg=#FFCCFF
> AM> [...]
> AM>
> AM> Notes:
> AM> 1. filetype.vim in an "after-directory" and with ":setf"
> AM> to avoid overriding already-detected "special" .txt files.
> AM> 2. With "default" before the highlight name in the syntax
> AM> file (but not without it) the colors from the colorscheme
> AM> (invoked from the vimrc) are used. (Without a colorscheme,
> AM> the "default" colors from the syntax file are still used.)
> AM> 3. Haven't succeeded (but haven't much tried) to make it
> AM> work for a more complex filetype with an already defined
> AM> syntax like HTML
> AM> 4. After entering the above changes, Vim must be restarted
> AM> for them to take effect.
>
> Hope it helps give you some grounds from which to find a
> solution (even if I think Tony's a tad messed-in-the-head for choosing
> yellow/magenta for alternating colors ;-)
>
> -tim

Thanks much, Tim, I will experiment with some of this and see what
happens! Thanks also to Tony and Benji for coming up with this in the
first place.

--
Aaron
"The Dude abides."


Re: Shading alternating patterns.

2006-10-10 Thread A.J.Mechelynck

Aaron wrote:
I've been swapping my subscribed addresses, so I apologize if this got 
posted more than once.


My question is casual, but I wasn't able to find anything on the FAQs or
Google, so I hope someone here can tell me if I'm nuts or not.

In my ideal world (which, so far, Vim has done an excellent job creating
for me), CSS definitions would be lightly, alternatingly shaded. Here at
work, we format our CSS files like so:

.selector { property: value; property: value;
property: value; }
.selector { property: value; }
.selector { property: value; property: value;
property: value; property: value; }

You can see immediately that it is easy enough to scan down the left
column to find the selector you're interested in, but it's a bit more
difficult to see where one definition's property list starts and
another's ends (especially with syntax highlighting in there).

Is there some way, perhaps through a syntax rule, or rules, to have Vim
shade the background of *alternating* CSS definitions, assuming this
file format?

I'm handy with regex but I don't know if Vim's syntax system is even up
to the task. A function that ran against the buffer would be fine, too.

Thanks!



I don't know, but there is an easy way to find where one particular definition 
starts and ends:


1. Place the cursor on the opening brace (e.g. with /{ )
2. Hit V (i.e. shift-v) to enter linewise Visual mode
3. Hit % to move the cursor to the closing brace.

The whole selector and property list is now highlighted. You can even hit Esc 
to quit Visual mode and go back to it later with gv



Best regards,
Tony.


Re: Shading alternating patterns.

2006-10-10 Thread Tim Chase

> Is there some way, perhaps through a syntax rule, or
> rules, to have Vim shade the background of *alternating*
> CSS definitions, assuming this file format?

While I'm not sure the below will solve it, I've pasted in
some dialog from Benji Fisher and Tony Mechelynck (from back
in February of this year, which I saved as I thought it was
a nifty stunt) regarding the highlighting of alternate
*lines*.  One might be able to use this as a foundation for
doing alternate CSS-rule-blocks:

BF>> I have not used syntax much either, but I decided to test
BF>> this.  I think what you want is (two :hi lines and)
BF>> something like this:
BF>>
BF>> :syn match Oddlines "^.*$" contains=ALL nextgroup=Evenlines 
skipnl
BF>> :syn match Evenlines "^.*$" contains=ALL nextgroup=Oddlines 
skipnl

BF>>
BF>> In other words, drop "transparent" and add "skipnl".  I
BF>> tested it with
BF>>
BF>> :syn clear
BF>>
BF>> first; I am not sure how well it will work without that.
AM>
AM> I agree about "skipnl".
AM>
AM> Got it to work on text files, as follows (on W32)
AM>
AM>  ~/vimfiles/after/syntax/text.vim
AM> hi default Oddlines ctermbg=grey guibg=#808080
AM> hi default Evenlines cterm=NONE gui=NONE
AM>
AM> syn match Oddlines "^.*$" contains=ALL nextgroup=Evenlines skipnl
AM> syn match Evenlines "^.*$" contains=ALL nextgroup=Oddlines skipnl
AM>
AM>  $VIM/vimfiles/after/filetype.vim
AM> augroup filetypedetect
AM>  au BufRead,BufNewFile *.txt setf text
AM> augroup END
AM>
AM>  ~/vimfiles/colors/almost-default.vim
AM> [...]
AM> hi Oddlines ctermbg=yellow guibg=#99
AM> hi Evenlines ctermbg=magenta guibg=#FFCCFF
AM> [...]
AM>
AM> Notes:
AM> 1. filetype.vim in an "after-directory" and with ":setf"
AM> to avoid overriding already-detected "special" .txt files.
AM> 2. With "default" before the highlight name in the syntax
AM> file (but not without it) the colors from the colorscheme
AM> (invoked from the vimrc) are used. (Without a colorscheme,
AM> the "default" colors from the syntax file are still used.)
AM> 3. Haven't succeeded (but haven't much tried) to make it
AM> work for a more complex filetype with an already defined
AM> syntax like HTML
AM> 4. After entering the above changes, Vim must be restarted
AM> for them to take effect.

Hope it helps give you some grounds from which to find a
solution (even if I think Tony's a tad messed-in-the-head for 
choosing yellow/magenta for alternating colors ;-)


-tim







Shading alternating patterns.

2006-10-10 Thread Aaron
I've been swapping my subscribed addresses, so I apologize if this got 
posted more than once.


My question is casual, but I wasn't able to find anything on the FAQs or
Google, so I hope someone here can tell me if I'm nuts or not.

In my ideal world (which, so far, Vim has done an excellent job creating
for me), CSS definitions would be lightly, alternatingly shaded. Here at
work, we format our CSS files like so:

.selector { property: value; property: value;
property: value; }
.selector { property: value; }
.selector { property: value; property: value;
property: value; property: value; }

You can see immediately that it is easy enough to scan down the left
column to find the selector you're interested in, but it's a bit more
difficult to see where one definition's property list starts and
another's ends (especially with syntax highlighting in there).

Is there some way, perhaps through a syntax rule, or rules, to have Vim
shade the background of *alternating* CSS definitions, assuming this
file format?

I'm handy with regex but I don't know if Vim's syntax system is even up
to the task. A function that ran against the buffer would be fine, too.

Thanks!

--
Aaron


RE: Setting up netrw

2006-10-10 Thread Suresh Govindachar
 
  Dr. Chip wrote
  > Suresh Govindachar wrote [yesterday]:
  >>
  >> I downloaded all sources and built gvim yesterday.
  >>
  > Try using the latest netrw, which is currently up to v107b. Its
  > been a bit smarter about quoting; and its quoting can be
  > overridden by specifying g:netrw_shq in one's <.vimrc>.

  The version of netrw in the vim sources, on vim.org and on your
  web-site all differ. Since netrw is part of the vim runtime-
  sources, could you please coordinate your releases with Bram?

  Also, there is a note on your web-site about needing to update
  vimball. Is vimball part of vim runtime-sources?

  If you would prefer people use netrw under vimfiles/ rather than
  under the main vim directory, please have Bram remove netrw from
  the runtime-distribution.

  Thanks,

  --Suresh



vim | editing pdf files with vim

2006-10-10 Thread Nikolaos A. Patsopoulos

Hi all,

is there a way to edit pdf files with vim? If not pdf as is, then eps or 
postscript? I tried with either format but the text kept been converted 
to sthl ike ASCII code.


Thanks,

Nikos



Re: Setting up netrw

2006-10-10 Thread Charles E Campbell Jr

Suresh Govindachar wrote:

 
 Close ... 
 From inside gvim, I tried both of the following:
  
   :Nread  scp://111.11.11.111/home/suresh/examples/mcf/vmul/manager/manager_vmul.c

 and
   :sf 
scp://111.11.11.111/home/suresh/examples/mcf/vmul/manager/manager_vmul.c

 But the system command they each resulted in was:
  
   c:/opt/putty/pscp.exe -l user -pw password -q -batch '111.11.11.111:home/suresh/examples/mcf/vmul/manager/manager_vmul.c'
VID62.tmp.c  


 The preceding system command doesn't work.  Two changes need to be
 made to make it work:
 
 1) Remove the single quotes '' [unknown host with '']

 2) Add a / after the : in :home/suresh [file does not exist without /]
 
 I downloaded all sources and built gvim yesterday.
 

Try using the latest netrw, which is currently up to v107b.  Its been a 
bit smarter about quoting; and its

quoting can be overridden by specifying g:netrw_shq in one's <.vimrc>.

Regards,
Chip Campbell



diffoff

2006-10-10 Thread Vigil

"The ":diffoff" command resets the relevant options to their default value.
This may be different from what the values were before diff mode was started,
the old values are not remembered."

Is it on the to-do list to make diffoff restore from previous values rather 
than default ones, or is there already an option somewhere that toggles the 
behaviour?


--

.


Re: Bug in :(un)lockvar

2006-10-10 Thread Bram Moolenaar

Hari Krishna Dara wrote:

> I need to create a doubly linked list and since this will cause problem
> with lockvar, I will just comment the lock/unlockvar commands. I am
> wondering if you have any plans to fix this issue. The lockvar is a
> great way to prevent accidental changes (and it already helped me once)
> so I would rather not comment it.

Fixing lockvar for recursive references is in the todo list.

-- 
If Pacman had affected us as kids we'd be running around in dark rooms,
munching pills and listening to repetitive music.
   -- Marcus Brigstocke

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///