syntax/man.vim: manSubHeading is a bit too general?

2007-04-09 Thread Nikolai Weibull

The manSubHeading is defined as

syn match  manSubHeading  ^\s\{3\}[a-z][a-z ]*[a-z]$

This will, however, match more lines than I think is intended.  It
will, for example, match the line

\t  returns are what are recorded and compared with the data git keeps

where \t is a horizontal tabulation.  I'm guessing that the actual
regex should be

 ^ \{3\}[a-z][a-z ]*[a-z]$

but I'm not sure; I haven't been able to find a reference for the
display of manual pages.

Anyone have any insight into this issue?

 nikolai


Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-09 Thread Charles E Campbell Jr

Nikolai Weibull wrote:


The manSubHeading is defined as

syn match  manSubHeading  ^\s\{3\}[a-z][a-z ]*[a-z]$

This will, however, match more lines than I think is intended.  It
will, for example, match the line

\t  returns are what are recorded and compared with the data git keeps

where \t is a horizontal tabulation.  I'm guessing that the actual
regex should be

 ^ \{3\}[a-z][a-z ]*[a-z]$

but I'm not sure; I haven't been able to find a reference for the
display of manual pages.

Anyone have any insight into this issue?


I suggest bringing up syntax highlighting issues for a specific filetype 
with the syntax highlighting file's maintainer.
In this case, by looking at syntax/man.vim, its:  Gautam H. Mudunuri 
gmudunur AT informatica.com.


Regards,
Chip Campbell



Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-09 Thread Nikolai Weibull

On 4/9/07, Charles E Campbell Jr [EMAIL PROTECTED] wrote:


In this case, by looking at syntax/man.vim, its:  Gautam H. Mudunuri
gmudunur AT informatica.com.


Actually, this was actually the wrong maintainer.  Gautam was the
previous maintainer of this file.  Nam SungHyun [EMAIL PROTECTED]
maintains it now.

 nikolai


Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-09 Thread Ian Tegebo

On 4/9/07, Nikolai Weibull [EMAIL PROTECTED] wrote:

The manSubHeading is defined as

syn match  manSubHeading  ^\s\{3\}[a-z][a-z ]*[a-z]$

This will, however, match more lines than I think is intended.  It
will, for example, match the line

\t  returns are what are recorded and compared with the data git keeps

where \t is a horizontal tabulation.  I'm guessing that the actual
regex should be

  ^ \{3\}[a-z][a-z ]*[a-z]$

I hope nobody minds if I take this opportunity to ask a question about
vim's pattern matching.

After reading |pattern| I wonder if the following is more efficient:

syn match manSubHeading '^ \{3\}\l\l\?\l$'

Taken from |pattern|:

   - Matching with a collection can be slow, because each character in
 the text has to be compared with each character in the collection.
 Use one of the other atoms above when possible.  Example: \d is
 much faster than [0-9] and matches the same characters

Do people find this to make a different for moderate file sizes, e.g.
the man page for 'less' being ~2000 lines?

--
Ian Tegebo


Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-09 Thread Nikolai Weibull

On 4/9/07, Ian Tegebo [EMAIL PROTECTED] wrote:

On 4/9/07, Nikolai Weibull [EMAIL PROTECTED] wrote:



   ^ \{3\}[a-z][a-z ]*[a-z]$
I hope nobody minds if I take this opportunity to ask a question about
vim's pattern matching.

After reading |pattern| I wonder if the following is more efficient:

syn match manSubHeading '^ \{3\}\l\l\?\l$'


Yes, and it may be more correct as well, at least in the first and
last instance.  However, the second part may also contain a space, so
\l isn't correct there; and I don't know where you get that \? from.
This is the correct pattern:

 ^ \{3}\l[[:alpha:] ]*\l$

(I also noticed that the apparently accepted \{m\} is being used in
this file instead of the documented \{m})

One can of course ask oneself if a subsection heading must consist of
at least two letters.  I'm guessing that the intent was to force the
line to end with a non-space:

 ^ \{3}\l\%([[:alpha:] ]*\l\)\=$

In fact, I'd prefer it be written as

 ^ \{3}\a\%([[:alpha:] ]*\a\)\=$

as 'syn case ignore' is on, \l and \a will be the same.  However, \a
meshes better with [:alpha:] and may, depending on how all this is
implemented, be a miniscule amount faster.


Taken from |pattern|:

- Matching with a collection can be slow, because each character in
  the text has to be compared with each character in the collection.
  Use one of the other atoms above when possible.  Example: \d is
  much faster than [0-9] and matches the same characters

Do people find this to make a different for moderate file sizes, e.g.
the man page for 'less' being ~2000 lines?


Probably not.

 nikolai


Re: VIM Delete All Except

2007-04-09 Thread Zhaojun WU

On 4/6/07, cga2000 [EMAIL PROTECTED] wrote:

On Thu, Apr 05, 2007 at 10:10:03AM EDT, jas01 wrote:




If the file is really huge, you may find adopting a different strategy is
preferable.

If you're on linux or similar you might use a command-line tool such as:

$ grep Text[1-3] huge_file  a_few_lines

What this does is that it finds all the lines that contain at least one
occurrence of Text1, Text2, or Text3 in ./huge_file and copies them to
./a_few.lines.


Yes, I think sed/grep is more feasible and efficient to do this kind
of pre-processing tasks before you feed a huge file to VIM, although
VIM is capable of doing such thing. :-)

--
Best,
Zhaojun (Joseph)


how to delete all occur of a character

2007-04-09 Thread shawn bright

lo there,

i have a file ( actually a group of them ) and i need to delete the
quotation marks in each file, i am sure that vim has a tool for this.

sk


Re: how to delete all occur of a character

2007-04-09 Thread Przemyslaw Gawronski
Hi

 i have a file ( actually a group of them ) and i need to delete the
 quotation marks in each file, i am sure that vim has a tool for this.

vim file1 file2 

:argdo %s/\//gCR
:xaCR

Przemek
-- 
AIKIDO TANREN DOJO  -   Poland - Warsaw - Mokotow - Ursynow - Natolin
info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED]


Re: how to delete all occur of a character

2007-04-09 Thread Przemyslaw Gawronski
 vim file1 file2 

 :argdo %s/\//gCR
 :xaCR

Well, better do it this way:

:argdo %s/\//g | updateCR

Then vim will write only if there were any changes in the file.

Przemek
-- 
AIKIDO TANREN DOJO  -   Poland - Warsaw - Mokotow - Ursynow - Natolin
info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED]


Re: how to delete all occur of a character

2007-04-09 Thread Jean-Rene David
* Przemyslaw Gawronski [2007.04.09 09:45]:
 :argdo %s/\//g | updateCR

 is not special, so no need to quote it.

:argdo %s///g | updateCR

-- 
JR


Re: how to delete all occur of a character

2007-04-09 Thread Tim Chase

i have a file ( actually a group of them ) and i need to
delete the quotation marks in each file, i am sure that vim
has a tool for this.


For a single file, you want to use

:%s///g

For multiple files, you might want:

:set hidden
:argdo %s///g
   (review your changes)
:wall

(to write all the changes).

If they're funky windows quotes, you may have to copypaste 
them, perhaps using control-R followed by whichever register 
holds the copied quote (either an asterisk/plus-sign for the 
system clipboard, or the double-quote register).


You can read more at

:help :s
:help i_CTRL-R
:help registers


Hope this helps,

-tim



delete buffer questions

2007-04-09 Thread alebo

I need som things explained about the automatic delete buffers 1-9.

When I delete rows using dd the deleted text is put in the default buffer,
using dd again will put it in 1 and so on. 

But if I use another kind of deletion like dw, I couldnt fetch it from the 
buffers 1-9, only from the first unnamed buffer. Why is this so and which 
kind of delete operations are supported in the delete buffers?
-- 
View this message in context: 
http://www.nabble.com/delete-buffer-questions-tf3548826.html#a9907181
Sent from the Vim - General mailing list archive at Nabble.com.



Re: delete buffer questions

2007-04-09 Thread Tim Chase

When I delete rows using dd the deleted text is put in the
default buffer, using dd again will put it in 1 and so on.

But if I use another kind of deletion like dw, I couldnt fetch
it from the buffers 1-9, only from the first unnamed buffer.


For future reference, these are registers rather than buffers 
(a different concept, and using precise terminology can help 
folks on the list in their replies)


From :help quote_number

Numbered register 1 contains the text deleted
by the most recent delete or change command,
unless the command specified another register
or the text is less than one line (the small
delete register is used then).

The small-delete register is

-

holds deletions when they're smaller than a line (unless it was 
covered by the fairly lengthy list of exceptions covered in the 
quote_number help)



Why is this so and which kind of delete operations are
supported in the delete buffers?


I'm not sure why some things are arbitrarily chosen as small 
deletes, but any motion can be used with a delete.  If you want 
to ensure that the deleted contents go into the trickle-down list 
of registers, you can prefix your deletion with an explicit register:


1dw

This will force a trickle-down of the current history of 
deletions for any such deletion.  Odd things happen if you 
specify the middle of your history, such as


4dw

as it ends up in register #5 instead of #4 because of the nature 
of the trickle-down (or rather it gets put in #4, the 
trickle-down occurs and it also gets put in #1 so the formerly#4 
is now in #5).


Just a few musings on the peculiarties of them.  I don't usually 
use them unless I have previously used :reg to figure out which 
one I want...my memory isn't quite that good :)


HTH,

-tim





Re: delete buffer questions

2007-04-09 Thread Jean-Rene David
* alebo [2007.04.09 15:00]:
 But if I use another kind of deletion like dw, I
 couldnt fetch it from the buffers 1-9, only from
 the first unnamed buffer. Why is this so and
 which kind of delete operations are supported in
 the delete buffers?

If you delete less than one line, the data is put
in the small-delete register: -

:h quote-

It is number 3 in the list of register types found
at:

:h registers

You can see its current content by doing:

:di -

-- 
JR


Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-09 Thread Yakov Lerner

On 4/9/07, Nikolai Weibull [EMAIL PROTECTED] wrote:

The manSubHeading is defined as

syn match  manSubHeading  ^\s\{3\}[a-z][a-z ]*[a-z]$

This will, however, match more lines than I think is intended.  It
will, for example, match the line

\t  returns are what are recorded and compared with the data git keeps

where \t is a horizontal tabulation.


I never saw tabs in the formatted manpages. Did you ever
see tabs in the formatted manpages ? I think it contains only spaces.

Yakov


Re: syntax/man.vim: manSubHeading is a bit too general?

2007-04-09 Thread Nikolai Weibull

On 4/10/07, Yakov Lerner [EMAIL PROTECTED] wrote:

On 4/9/07, Nikolai Weibull [EMAIL PROTECTED] wrote:
 The manSubHeading is defined as

 syn match  manSubHeading  ^\s\{3\}[a-z][a-z ]*[a-z]$

 This will, however, match more lines than I think is intended.  It
 will, for example, match the line

 \t  returns are what are recorded and compared with the data git keeps

 where \t is a horizontal tabulation.

I never saw tabs in the formatted manpages. Did you ever
see tabs in the formatted manpages ? I think it contains only spaces.


Not in my tool chain; I get tabs.

 nikolai


***SPAM***

2007-04-09 Thread 李长青
hi,all:
   I am new to Vim,I am using Vim7.0 now,and it has no Syntax even when I 
set Syntax on,It stell has no syntax hignlighting,why?  Please help me. On 
Vim6.4 ,It has syntax hignlighting, but now (vim7.0) it doesn't.

Thanks.

yhntgbty
[EMAIL PROTECTED]
  2007-04-10


Re: ***SPAM***

2007-04-09 Thread Steven Woody

On 4/10/07, 李长青 [EMAIL PROTECTED] wrote:

hi,all:
   I am new to Vim,I am using Vim7.0 now,and it has no Syntax even when I set 
Syntax on,It stell has no syntax hignlighting,why?  Please help me. On Vim6.4 
,It has syntax hignlighting, but now (vim7.0) it doesn't.

Thanks.

yhntgbty
[EMAIL PROTECTED]
2007-04-10



i just copy the /usr/share/vim/vim70/vimrc_example.vim to
/usr/share/vim/vimrc and everything works fine then.

--
woody

then sun rose thinly from the sea and the old man could see the other
boats, low on the water and well in toward the shore, spread out
across the current.


Re: ***SPAM***

2007-04-09 Thread Xi Juanjie
If you updated vim to 7.0 using apt-get, perhpas you could check if the
runtimepath also be old in your vimrc.

for example, replaced /usr/share/vim/vim64 to /usr/share/vim/vim70

李长青 wrote:
 hi,all:
I am new to Vim,I am using Vim7.0 now,and it has no Syntax even when I 
 set Syntax on,It stell has no syntax hignlighting,why?  Please help me. On 
 Vim6.4 ,It has syntax hignlighting, but now (vim7.0) it doesn't.
 
 Thanks.
 
 yhntgbty
 [EMAIL PROTECTED]
   2007-04-10


***SPAM*** Re: Re: ***SPAM***_Vim70's hignlighting

2007-04-09 Thread 李长青
hi,all:
thank you.
I install vim70 as a new software ,not update from other 
version.
And there is not a file named vimrc_example.vim at the path 
/usr/share/vim/vim70,just a file named debian.vim.And when I install vim70 
completely,Thers is only one file like *.vim,and only one file named vimrc 
vimrc.tiny.


=== 2007-04-10 10:02:48 您在来信中写道:===

If you updated vim to 7.0 using apt-get, perhpas you could check if the
runtimepath also be old in your vimrc.

for example, replaced /usr/share/vim/vim64 to /usr/share/vim/vim70

李长青 wrote:
 hi,all:
I am new to Vim,I am using Vim7.0 now,and it has no Syntax even when 
 I set Syntax on,It stell has no syntax hignlighting,why?  Please help me. 
 On Vim6.4 ,It has syntax hignlighting, but now (vim7.0) it doesn't.
 
 Thanks.
 
 yhntgbty
 [EMAIL PROTECTED]
   2007-04-10


= = = = = = = = = = = = = = = = = = = =


致
礼!
 
 
李长青
[EMAIL PROTECTED]
  2007-04-10