Re: Replace all on a line

2006-06-26 Thread Jürgen Krämer

Hi,

Jerin Joy wrote:
 
 The replace all option 'g' doesn't seem to be working in my case. It
 replaces only the first occurrence on a line.
 
 for eg. in the following line I wanted to remove the extra whitespaces
 between input [] and the name of the variable:
 task init (input [1:0]   u, input [3:0]hash, input [3:0]hash_index1)
 
 Using:
 :%s/\][\ ]\+/\]\ /g
 
 replaces only for the first variable - input [1:0] u

was this really the command you typed inside VIM? I tested it and it
worked. But you can simplify it to

  :%s/] \+/] /g

which is a bit easier to read.

Regards,
Jürgen

-- 
Jürgen Krämer  Softwareentwicklung
HABEL GmbH  Co. KGmailto:[EMAIL PROTECTED]
Hinteres Öschle 2  Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99


Re: Replace all on a line

2006-06-26 Thread Jürgen Krämer

Hi,

Jerin Joy wrote:
 
 I tried the command with the \s instead of '\ ' and it doesn't work
 
 the command :%s/]\s\+/] /g changed
 task init (input [1:0]   u, input [3:0]hash, input [3:0]hash_index1)
 
 to
 task init (input [1:0] u, input [3:0]hash, input [3:0]hash_index1)
 
 Could something be hardcoded in my settings? I'm running vim 6.4.6 the
 default version with ubuntu 6.06.

maybe the 'gdefault' option is on. What does

  :verbose set gdefault?

output?

Regards,
Jürgen

-- 
Jürgen Krämer  Softwareentwicklung
HABEL GmbH  Co. KGmailto:[EMAIL PROTECTED]
Hinteres Öschle 2  Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99


Re: Replace all on a line

2006-06-26 Thread Jerin Joy

maybe the 'gdefault' option is on. What does

  :verbose set gdefault?
output?

it doesn't output anything. Cursor just comes back to the file.

Jerin



Regards,
Jürgen

--
Jürgen Krämer  Softwareentwicklung
HABEL GmbH  Co. KGmailto:[EMAIL PROTECTED]
Hinteres Öschle 2  Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99




--
http://jerinj.blogspot.com/
--


Re: Replace all on a line

2006-06-26 Thread Jürgen Krämer

Hi,

Jerin Joy wrote:
  maybe the 'gdefault' option is on. What does
 
:verbose set gdefault?
  output?

 it doesn't output anything. Cursor just comes back to the file.

did you enter the question mark after gdefault? This is necessary to
query the state of a boolean option.

Mit freundlichen Grüßen,
Jürgen Krämer

-- 
Jürgen Krämer  Softwareentwicklung
HABEL GmbH  Co. KGmailto:[EMAIL PROTECTED]
Hinteres Öschle 2  Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99


Capturing source errors

2006-06-26 Thread Robert Hicks
When I statup Vim I am getting source errors for a syntax file I am 
modifying but they go away so fast I cannot read what the errors are. 
How do I get Vim to show me those errors?


Robert



Adding keywords if a line starts with a certain word

2006-06-26 Thread Robert Hicks
I would like to add additional keywords if the first word or first 4 
characters of the statement is snit.


snit::type dog {
method {tail wag} {} {return Wag, wag}
method {tail droop} {} {return Droop, droop}
}

Since snit is there then I would like to added method as a keyword.

Robert



Re: Adding keywords if a line starts with a certain word

2006-06-26 Thread Tim Chase
I would like to add additional keywords if the first word or first 4 
characters of the statement is snit.


snit::type dog {
 method {tail wag} {} {return Wag, wag}
 method {tail droop} {} {return Droop, droop}
}

Since snit is there then I would like to added method as a keyword.


Your language here uses some definition/syntax with which I'm not 
familiar (might be smalltalk?).  I'm not sure what you mean that 
you would like method added as a keyword.  Do you want to add a 
third method line?  Having some before and after descriptions 
of the code might help clarify matters.


If you just want to perform actions on snits, and assuming you 
use consistent indentation such that snit:: is always at the 
beginning of the line, and its closing } is also always at the 
beginning of the line, you can do things like



:g/^snit::/.+,/^}/-s/regexp/replacement/g

or you can add fixed text lines like

:g/^snit/put ='method {tail falloff} {} {return Ouch, ouch!}'

Or you might be talking about Vim's syntax-highlighting, in which 
case:


do you want to just highlight snit?

:match Keyword /^snit/

Or do you want to dynamically create syntax-highlighting 
definitions based on things found in your method defintions?


With a bit of clarification, there's likely a fairly easy solution.

-tim







Re: Trouble getting the backupskip option to work

2006-06-26 Thread A.J.Mechelynck

Tom Purl wrote:

I use the potwiki plugin (which is pretty sweet by the way) to keep a
plain-text wiki on my desktop that I can edit using Vim.  All of my
documents are stored under my `$HOME/gtd/wiki` directory.

Occasionally, I need to do a full-text search of my wiki pages, which I
do using the `vimgrep` command.  I use the following basic syntax:

:vimgrep /searchterm/ $HOME/gtd/wiki/*

This works pretty well, except for the fact that it always returns two
matches for each search:  one from the real doc (for example,
FrontPage), and one from the backup of that doc (FrontPage~).

I would like to force Vim to not make backups of files in my wiki folder,
but still create backups for all of my other docs.  I therefore tried the
following command in my _vimrc:

set backupskip=$HOME/gtd/wiki/*

This, however, didn't work.  I also tried quoting the path, using a
relative path, etc.  I read the autocmd-patterns help, and followed it's
recommendations, but that still didn't work.

Does anyone know what I'm missing here?  Is my path incorrect, or am I
using the wrong option to achieve my goal?

Thanks in advance!

Tom Purl





Once a backup has been created, it won't spontaneously disappear. Under 
Unix, you could try running the following shell command:


rm -vf ~/gtd/wiki/*~

In Windows, it'll be harder, since IIUC explicit characters after a * 
wildcard aren't acted upon. Or you might try doing it in a bash shell 
(from cygwin, minGW, GnuWin32, ...). (If you are prudent, use ls first 
instead of rm -vf to make sure that _only_ backup files will be removed).


Oh, or maybe you could use Vim to expand the wildcards? If

!dir ~/gtd/wiki/*~

shows only the backup files, use

!del -y ~/gtd/wiki/*~

to remove them.


After that, your 'backupskip' option ought to work.


Best regards,
Tony.


Re: Trouble getting the backupskip option to work

2006-06-26 Thread A.J.Mechelynck

A.J.Mechelynck wrote:

Tom Purl wrote:

I use the potwiki plugin (which is pretty sweet by the way) to keep a
plain-text wiki on my desktop that I can edit using Vim.  All of my
documents are stored under my `$HOME/gtd/wiki` directory.

Occasionally, I need to do a full-text search of my wiki pages, which I
do using the `vimgrep` command.  I use the following basic syntax:

:vimgrep /searchterm/ $HOME/gtd/wiki/*

This works pretty well, except for the fact that it always returns two
matches for each search:  one from the real doc (for example,
FrontPage), and one from the backup of that doc (FrontPage~).

I would like to force Vim to not make backups of files in my wiki folder,
but still create backups for all of my other docs.  I therefore tried the
following command in my _vimrc:

set backupskip=$HOME/gtd/wiki/*

This, however, didn't work.  I also tried quoting the path, using a
relative path, etc.  I read the autocmd-patterns help, and followed it's
recommendations, but that still didn't work.

Does anyone know what I'm missing here?  Is my path incorrect, or am I
using the wrong option to achieve my goal?

Thanks in advance!

Tom Purl





Once a backup has been created, it won't spontaneously disappear. Under 
Unix, you could try running the following shell command:


rm -vf ~/gtd/wiki/*~

In Windows, it'll be harder, since IIUC explicit characters after a * 
wildcard aren't acted upon. Or you might try doing it in a bash shell 
(from cygwin, minGW, GnuWin32, ...). (If you are prudent, use ls first 
instead of rm -vf to make sure that _only_ backup files will be removed).


Oh, or maybe you could use Vim to expand the wildcards? If

!dir ~/gtd/wiki/*~

shows only the backup files, use

!del -y ~/gtd/wiki/*~

to remove them.


After that, your 'backupskip' option ought to work.


Best regards,
Tony.




Oops! I should have written :!dir and :!del with colon.

Best regards,
Tony.


How to open file readonly from inside vim ?

2006-06-26 Thread Yakov Lerner

There is a file x that is opened in another vim, and
.x.swp file exists.

I have another  instance of vim that has many buffers already
open. I want to open file x in this vim readonly,
without the  'E325 Found swapfile' dialog. (like vim -R would,
but without starting new vim)

How do I do it  ? I tried ':e +set\ ro x' but it sort of
doesn't work. It still brings up the 'Found swapfile'
dialog (and then opens file readonly). So, How to
open file readonly from inside vim ?

Yakov


Re: Adding keywords if a line starts with a certain word

2006-06-26 Thread Robert Hicks

Tim Chase wrote:
I would like to add additional keywords if the first word or first 4 
characters of the statement is snit.


snit::type dog {
 method {tail wag} {} {return Wag, wag}
 method {tail droop} {} {return Droop, droop}
}

Since snit is there then I would like to added method as a keyword.


Your language here uses some definition/syntax with which I'm not 
familiar (might be smalltalk?).  I'm not sure what you mean that you 
would like method added as a keyword.  Do you want to add a third 
method line?  Having some before and after descriptions of the code 
might help clarify matters.


Snit is an OO extension to Tcl.



If you just want to perform actions on snits, and assuming you use 
consistent indentation such that snit:: is always at the beginning of 
the line, and its closing } is also always at the beginning of the 
line, you can do things like


What I am looking for is if snit is the first word then method will 
be added as a keyword and colored.


snip


Or do you want to dynamically create syntax-highlighting definitions 
based on things found in your method defintions?




Yes, I believe that is correct. Actually it might be easier to find if 
snit is anywhere in the file at the beginning of the line (it will 
always be at the beginning) and then adding some extra keywords in to be 
colored.



With a bit of clarification, there's likely a fairly easy solution.



Did I clarify anything? I hope so.

Robert



Re: How to open file readonly from inside vim ?

2006-06-26 Thread A.J.Mechelynck

Yakov Lerner wrote:

There is a file x that is opened in another vim, and
.x.swp file exists.

I have another  instance of vim that has many buffers already
open. I want to open file x in this vim readonly,
without the  'E325 Found swapfile' dialog. (like vim -R would,
but without starting new vim)

How do I do it  ? I tried ':e +set\ ro x' but it sort of
doesn't work. It still brings up the 'Found swapfile'
dialog (and then opens file readonly). So, How to
open file readonly from inside vim ?

Yakov




Use
:view foobar.ext
or
:sview foobar.ext

(instead of :edit or :new/:split respectively).


HTH,
Tony.


Re: Trouble getting the backupskip option to work

2006-06-26 Thread Tom Purl
 I would like to force Vim to not make backups of files in my wiki
 folder,
 but still create backups for all of my other docs.  I therefore tried
 the
 following command in my _vimrc:

 set backupskip=$HOME/gtd/wiki/*

 This, however, didn't work.  I also tried quoting the path, using a
 relative path, etc.  I read the autocmd-patterns help, and followed
 it's
 recommendations, but that still didn't work.
 ...
 Does anyone know what I'm missing here?  Is my path incorrect, or am I
 using the wrong option to achieve my goal?


 Once a backup has been created, it won't spontaneously disappear. Under
 Unix, you could try running the following shell command:

 rm -vf ~/gtd/wiki/*~
 ...
 Oh, or maybe you could use Vim to expand the wildcards? If

 !dir ~/gtd/wiki/*~

 shows only the backup files, use

 !del -y ~/gtd/wiki/*~

 to remove them.

 After that, your 'backupskip' option ought to work.

Thanks for the quick reply AJ!  I tried this same configuration on Linux
just now and got the same results.  Here's basically what I did (on both
Windows and Linux):

1. I opened my $HOME/gtd/wiki directory within Vim using netrw.
2. I deleted the FrontPage~ doc using netrw
3. I then opened my FrontPage doc, edited it and saved it.
4. I then opened my $HOME/gtd/wiki directory again within Vim using netrw.

Unfortunately, the FrontPage~ doc was created again.  Here's what's in my
vimrc:

set backupskip=$HOME/gtd/wiki/*

Is there anything else I could be missing?

Thanks again!

Tom Purl



Re: Trouble getting the backupskip option to work

2006-06-26 Thread A.J.Mechelynck

Tom Purl wrote:

Tom Purl wrote:

I would like to force Vim to not make backups of files in my wiki
folder,
but still create backups for all of my other docs.  I therefore tried
the
following command in my _vimrc:

set backupskip=$HOME/gtd/wiki/*

This, however, didn't work.  I also tried quoting the path, using a
relative path, etc.  I read the autocmd-patterns help, and followed
it's
recommendations, but that still didn't work.
...
Does anyone know what I'm missing here?  Is my path incorrect, or am
I
using the wrong option to achieve my goal?

Once a backup has been created, it won't spontaneously disappear.
Under
Unix, you could try running the following shell command:

rm -vf ~/gtd/wiki/*~
...
Oh, or maybe you could use Vim to expand the wildcards? If

!dir ~/gtd/wiki/*~

shows only the backup files, use

!del -y ~/gtd/wiki/*~

to remove them.

After that, your 'backupskip' option ought to work.

Thanks for the quick reply AJ!  I tried this same configuration on Linux
just now and got the same results.  Here's basically what I did (on both
Windows and Linux):

1. I opened my $HOME/gtd/wiki directory within Vim using netrw.
2. I deleted the FrontPage~ doc using netrw
3. I then opened my FrontPage doc, edited it and saved it.
4. I then opened my $HOME/gtd/wiki directory again within Vim using
netrw.

Unfortunately, the FrontPage~ doc was created again.  Here's what's in
my
vimrc:

set backupskip=$HOME/gtd/wiki/*

Is there anything else I could be missing?

Thanks again!

Tom Purl



Remove the quotes:

:set backupskip=$HOME/gtd/wiki/*


Thanks again Tony, I tried what you suggested, but I'm still getting
backups.  This is really odd.




Hm. Then I don't know what is wrong. (Help, anyone?) I don't have this 
problem because I use :set nobackup writebackup.



Best regards,
Tony.


Re: Man command not working with Vim 7

2006-06-26 Thread Benji Fisher
On Sun, Jun 25, 2006 at 08:16:54PM -0600, Trent Michael Gamblin wrote:
 I'm having trouble getting the Man command working with Vim. I have the 
 line:
 
runtime ftplugin/man.vim
 
 in my ~/.vimrc. When I type :Man man page I get this:
 
 Vim: Warning: Output is not to a terminal
 Vim: Warning: Input is not from a terminal
 ^M
 Error executing formatting or display command.
 System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip 
 -c '/usr/sNo manual entry for va_arg
 -stdin-2[readonly]2157L,-5815C1;24r?12;25h?12l?25h27mmH2J1;1H35mSTDARG(3)
 
 33mSYNOPSISm
 35m   #include m31mstdarg.hm11;8H32mvoidm 
 36mva_startm(32mva_listm ap, las
 
 It looks like some errors followed by the beginning of the man page. Can 
 anyone help me?
 Thanks. Have a nice day.

 What version of vim and what OS are you using?

 Unless someone has a better idea, I need more information to figure
this out.  You can try

:redir  vimlog.txt
:12 verbose Man cvs
:redir END

and then look at vimlog.txt or send it to the list.

HTH --Benji Fisher


Re: How to replace CR with LF

2006-06-26 Thread Yakov Lerner

On 6/26/06, Yakov Lerner [EMAIL PROTECTED] wrote:

On 6/26/06, Steve Baldwin [EMAIL PROTECTED] wrote:
 Dear Guru's,

 This is probably a silly question, but I can't work it out :-(

 I have a file containing carriage returns and I want to replace them with
 line feeds.  Note it is not CR-LF - LF, but just CR - LF.  Can someone
 please enlighten me as to how to do this.

 tr '\015 '\012' input output


Oh wait. I need to use vim. How about:
tr '\015 '\012' input output
vim output
ZZ

Yakov


Re: How to replace CR with LF

2006-06-26 Thread A.J.Mechelynck

Steve Baldwin wrote:

Dear Guru's,

This is probably a silly question, but I can't work it out :-(

I have a file containing carriage returns and I want to replace them with
line feeds.  Note it is not CR-LF - LF, but just CR - LF.  Can someone
please enlighten me as to how to do this.

Thanks very much.






:e ++ff=mac foobar.txt
:w ++ff=unix

see
:help ++opt
:help 'fileformat'


HTH,
Tony.


Re: How to replace CR with LF

2006-06-26 Thread Bill McCarthy
On Mon 26-Jun-06 3:06pm -0600, Steve Baldwin wrote:

 I have a file containing carriage returns and I want to
 replace them with line feeds.  Note it is not CR-LF - LF,
 but just CR - LF.  Can someone please enlighten me as to
 how to do this.

If you don't have mac format in your 'ffs', first add it
before loading your mac file:

:se ffs+=mac

After loading your mac file:

:se ff=unix

-- 
Best regards,
Bill



RE: How to replace CR with LF

2006-06-26 Thread Steve Baldwin
Thanks all.  That worked very nicely.

I'm curious though - is there any way to substitute CR with LF using
regexp's?

Thanks,

Steve

 -Original Message-
 From: Bill McCarthy
 Sent: Tuesday, 27 June 2006 6:54 AM
 To: Steve Baldwin
 Cc: Vim List
 Subject: Re: How to replace CR with LF
 
 On Mon 26-Jun-06 3:06pm -0600, Steve Baldwin wrote:
 
  I have a file containing carriage returns and I want to
  replace them with line feeds.  Note it is not CR-LF - LF,
  but just CR - LF.  Can someone please enlighten me as to
  how to do this.
 
 If you don't have mac format in your 'ffs', first add it
 before loading your mac file:
 
 :se ffs+=mac
 
 After loading your mac file:
 
 :se ff=unix
 
 --
 Best regards,
 Bill





Re: How to replace CR with LF

2006-06-26 Thread Tim Chase

I'm curious though - is there any way to substitute CR with LF
using regexp's?


You could try the somewhat odd-looking

:%s/\r/\r/g

which has worked in some cases for me...

-tim






Re: Man command not working with Vim 7

2006-06-26 Thread Charles E Campbell Jr

Eric Arnold wrote:


I was having some problems getting manpageview to work on Windows:


Thank you for the feedback!  I'll look into it (I hope) later on my 
WinXP machine.

Do you use cygwin?

Regards,
Chip Campbell



Re: Man command not working with Vim 7

2006-06-26 Thread Eric Arnold

On 6/26/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote:

Eric Arnold wrote:

 I was having some problems getting manpageview to work on Windows:

Thank you for the feedback!  I'll look into it (I hope) later on my
WinXP machine.
Do you use cygwin?


Yes.


Re: How to replace CR with LF

2006-06-26 Thread Michael Naumann
Yes there is, strange as it may seem:

s/\r/\r/

does it

HTH, Michael

On Monday 26 June 2006 23:20, Steve Baldwin wrote:
 Thanks all.  That worked very nicely.
 
 I'm curious though - is there any way to substitute CR with LF using
 regexp's?
 
 Thanks,
 
 Steve
 
  -Original Message-
  From: Bill McCarthy
  Sent: Tuesday, 27 June 2006 6:54 AM
  To: Steve Baldwin
  Cc: Vim List
  Subject: Re: How to replace CR with LF
  
  On Mon 26-Jun-06 3:06pm -0600, Steve Baldwin wrote:
  
   I have a file containing carriage returns and I want to
   replace them with line feeds.  Note it is not CR-LF - LF,
   but just CR - LF.  Can someone please enlighten me as to
   how to do this.
  
  If you don't have mac format in your 'ffs', first add it
  before loading your mac file:
  
  :se ffs+=mac
  
  After loading your mac file:
  
  :se ff=unix
  
  --
  Best regards,
  Bill
 
 
 
 




RE: How to replace CR with LF

2006-06-26 Thread Steve Baldwin
Marvellous.  Thanks again to all who responded.

Steve

 -Original Message-
 From: Michael Naumann
 Sent: Tuesday, 27 June 2006 7:30 AM
 To: vim@vim.org
 Subject: Re: How to replace CR with LF
 
 Yes there is, strange as it may seem:
 
 s/\r/\r/
 
 does it
 
 HTH, Michael
 
 On Monday 26 June 2006 23:20, Steve Baldwin wrote:
  Thanks all.  That worked very nicely.
 
  I'm curious though - is there any way to substitute CR with LF using
  regexp's?
 
  Thanks,
 
  Steve
 
   -Original Message-
   From: Bill McCarthy
   Sent: Tuesday, 27 June 2006 6:54 AM
   To: Steve Baldwin
   Cc: Vim List
   Subject: Re: How to replace CR with LF
  
   On Mon 26-Jun-06 3:06pm -0600, Steve Baldwin wrote:
  
I have a file containing carriage returns and I want to
replace them with line feeds.  Note it is not CR-LF - LF,
but just CR - LF.  Can someone please enlighten me as to
how to do this.
  
   If you don't have mac format in your 'ffs', first add it
   before loading your mac file:
  
   :se ffs+=mac
  
   After loading your mac file:
  
   :se ff=unix
  
   --
   Best regards,
   Bill
 
 
 
 
 





Re: Man command not working with Vim 7

2006-06-26 Thread Benji Fisher
On Sun, Jun 25, 2006 at 08:16:54PM -0600, Trent Michael Gamblin wrote:
 I'm having trouble getting the Man command working with Vim. I have the 
 line:
 
runtime ftplugin/man.vim
 
 in my ~/.vimrc. When I type :Man man page I get this:
 
 Vim: Warning: Output is not to a terminal
 Vim: Warning: Input is not from a terminal
 ^M
 Error executing formatting or display command.
 System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip 
 -c '/usr/sNo manual entry for va_arg
 -stdin-2[readonly]2157L,-5815C1;24r?12;25h?12l?25h27mmH2J1;1H35mSTDARG(3)
 
 33mSYNOPSISm
 35m   #include m31mstdarg.hm11;8H32mvoidm 
 36mva_startm(32mva_listm ap, las
 
 
 It looks like some errors followed by the beginning of the man page. Can 
 anyone help me?
 Thanks. Have a nice day.

On Mon, Jun 26, 2006 at 04:47:19PM -0600, Trent Michael Gamblin wrote:
 Benji Fisher wrote:
 
 What version of vim and what OS are you using?
 
 Unless someone has a better idea, I need more information to figure
 this out.  You can try
 
 :redir  vimlog.txt
 :12 verbose Man cvs
 :redir END
 
 and then look at vimlog.txt or send it to the list.
 
 I'm using Vim 7.0 and Fedora Core 4. Here is the output of the commands 
 you wrote, which
 doesn't show anything to me:
 
[snip]
 continuing in BufEnter Auto commands for *
 
 calling function SNR6_GetPage..SNR6_GetCmdArg
 
 function SNR6_GetPage..SNR6_GetCmdArg returning 'cvs'
 
 continuing in function SNR6_GetPage
 
 Calling shell to execute: (/usr/bin/man cvs | col -b) /tmp/v364103/2 21
 17 more lines
[snip]
 
 I have also tried the manpageview script suggested but I get
 Vim: Warning: Output is not to a terminal
 And then the only thing I can do is Ctrl-Z and kill vim
 
 I would appreciate any help very much. Thanks.

 I understand some of what is going on, but not all.

 The part I did not snip seems to be where the problem is.  When I
try it, I get something similar but with 1323 more lines, presumably the
whole man page, instead of 17 lines.

 The GetPage() function is defined in the default ftplugin/man.vim ;
the SNR6_ part means that it is a script-local function (defined as
s:GetPage() ) and this is the sixth script that was :source'd when you
started vim.  (You can confirm this with :scriptnames .)  Looking at
$VIMRUNTIME/ftplugin/man.vim and the definition of s:GetPage() (well, it
is defined as SIDGetPage(), close enough), I see the line

  silent exec r!/usr/bin/man .s:GetCmdArg(sect, page). | col -b

and this is what calls man cvs, filters it through col -b (to remove
backspaces and other nasties), and reads it into the empty buffer.

 I think this is important, but I do not understand it completely.
When I try

$ man cvs | col -b | less

or simply

$ man cvs | less

I get a similar error message, Error executing formatting or display
command ...  after I exit less.  I guess that was sent to stderr?  (I
am pretty sure that man is /usr/bin/man .)  So somehow vim is reading
stderr into your buffer instead of stdout?

 Again, maybe someone else can figure this out.  If not, here are
some more things to try as we attempt to figure out what is going wrong.

$ vim -u NONE
:runtime ftplugin/man.vim
:Man cvs

This will start up vim without your usual vimrc file.  Is the problem
still there?  If the problem goes away, maybe you have some weird
setting for your 'shellredir' option or something.  What does

:set shell? shellredir?
:echo $SHELL

tell you?

 Next, you can try (from an empty buffer)

:r! man cvs

or

:r! man cvs | col -b

Do you get the same error message, or do you get the man page?

HTH --Benji Fisher


Re: Man command not working with Vim 7

2006-06-26 Thread Eric Arnold

This

$ vim -u NONE
:runtime ftplugin/man.vim
:Man cvs

worked for me,  and

:r! man cvs | col -b

failed with my normal   .vimrc   , so I tracked it down to needing:

set shellxquote=\

The backslash is required.  I had shellxquote='  for other situations.
I seems like I've got some shell commands which require different
settings  :-(


Re: Man command not working with Vim 7

2006-06-26 Thread Trent Michael Gamblin

Benji Fisher wrote:


I understand some of what is going on, but not all.

The part I did not snip seems to be where the problem is.  When I
try it, I get something similar but with 1323 more lines, presumably the
whole man page, instead of 17 lines.

The GetPage() function is defined in the default ftplugin/man.vim ;
the SNR6_ part means that it is a script-local function (defined as
s:GetPage() ) and this is the sixth script that was :source'd when you
started vim.  (You can confirm this with :scriptnames .)  Looking at
$VIMRUNTIME/ftplugin/man.vim and the definition of s:GetPage() (well, it
is defined as SIDGetPage(), close enough), I see the line

 silent exec r!/usr/bin/man .s:GetCmdArg(sect, page). | col -b

and this is what calls man cvs, filters it through col -b (to remove
backspaces and other nasties), and reads it into the empty buffer.

I think this is important, but I do not understand it completely.
When I try

$ man cvs | col -b | less

or simply

$ man cvs | less

I get a similar error message, Error executing formatting or display
command ...  after I exit less.  I guess that was sent to stderr?  (I
am pretty sure that man is /usr/bin/man .)  So somehow vim is reading
stderr into your buffer instead of stdout?

Again, maybe someone else can figure this out.  If not, here are
some more things to try as we attempt to figure out what is going wrong.

$ vim -u NONE
:runtime ftplugin/man.vim
:Man cvs

This will start up vim without your usual vimrc file.  Is the problem
still there?  

Almost the same thing. It first says Output is not a terminal then 
when I type something

it shows the same ugly buffer from my first post.


If the problem goes away, maybe you have some weird
setting for your 'shellredir' option or something.  What does

:set shell? shellredir?
:echo $SHELL

tell you?
 



shell=/bin/bash
shellredir=%s 21
/bin/bash


Next, you can try (from an empty buffer)

:r! man cvs

or

:r! man cvs | col -b

Do you get the same error message, or do you get the man page?
 


I get the same error messages and partial unformatted man page.

Part of the error message is:
Error executing formatting or display command.
System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip -c 
'/usr/share/man/man1/cvs.1.gz') | /usr/bin/gtbll | /usr/bin/nroff -c 
--legacy ISO-8859-1 -mandoc 2/dev/null | col -b | view -c 'set ft=man 
nomod nolist' -) exited with status 256.

No manual entry for cvs

When I run that command from the shell I get the man page formatted 
perfectly. So I wonder what program is exiting with status 256 and what 
that particular error code means.


BTW, I had to make a symbol link from gtbl to gtbll, since I didn't have 
gtlbll.


Thanks for your help.


foldmethod=marker confusing brace matching syntax highlighting?

2006-06-26 Thread Kamil Kisiel

I've started using foldmethod=marker for folding in my C++ source
files. Usually it works okay, but I find that several times a day the
syntax highlighting seems to get confused and start highlighting
braces after a particular fold in red, as if they did not have a
matching brace. This is never actually the case, and just doing an :e
filename again makes the problem go away for a while. It's
nevertheless an irritating issue and it just seems to occur at random.
Has anyone else had the same experience? Is there a fix? I'm using Vim
7.0 on WinXP.

--
Kamil Kisiel [EMAIL PROTECTED]