Filter :map output

2006-05-31 Thread Eric Leenman

Hi,

Is it possible to filter the :map output?
For example to only show the mappings that have CTRL or Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




Re: vim7: E788 is too restrictive

2006-05-31 Thread Christian J. Robinson
Today (Wed, 31 May 2006), Hari Krishna Dara wrote:

> The handling of FileChangedRO was never smooth for me. As a
> workaround, I am thinking of avoiding a reload altogether and just
> mark the buffer as 'noro'. I relied upon the reload for its side
> effects before, but I should be able to force them directly, so all
> I can think of that needs to be done after a successful checkout is
> to mark the buffer as non-readonly. Any comments?

My problem with that is that RCS's "co"/"ci" commands modify the file
on disk if you have some of the special $...$ tags within the file, so
a reload of the buffer is essentially mandatory.

- Christian

-- 
   Never hold a dustbuster and a cat at the same time.
Christian J. Robinson <[EMAIL PROTECTED]> http://infynity.spodzone.com/
   PGP keys: 0x893B0EAF / 0xFB698360   http://infynity.spodzone.com/pgp


Re: Problem with OmniCompletion

2006-05-31 Thread Hari Krishna Dara

On Thu, 1 Jun 2006 at 10:30am, Bos, Eric (Contractor) wrote:

> I just tried omnicompletion for the first time (vim70 on winXP).
>
> In a C++ file, I entered mC, and it started looking fo r things starting
> with capital M, i.e. MC. This is a problem in itself since C++ is case
> sensitivie.
>
> Mor annoyingly, I hit delete to go back to that 'M' and make it an 'm'.
> Vim then went into an endless loop trying to list everything in my sytem
> starting with 'M'. I have 250,000 lines of code indexed via ctags (I
> presume completion uses the same mechanism as the tags functionality).

Seems like the same problem I reported recently regarding the 
triggering an insert-mode completion (as if ^X^N or ^X^L is pressed).
Does Vim show "Whole line completion" or something like that at the
bottom while it is scanning for matches? You should be able to press ^C
for Vim to stop doing this (worked for me at least).

-- 
Thanks,
Hari

>
> In any case, after looking at a frozen vim for a few minutes, I realised
> it was never going to come back to me. At that stage even killing vim
> was hard. I really think this needs looking at.
>
> Cheers.
>
> Eric Bos, Contractor (Software Development).
> SLEW Group, EWRD, DSTO Edinburgh, South Australia Ph 8259-4264, Mob 041
> 8388 547
>
> IMPORTANT: This email remains the property of the Australian Defence
> Organisation and is subject to the jurisdiction of section 70 of the
> CRIMES ACT 1914. If you have received this email in error, you are
> requested to contact the sender and delete the email.

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


Re: vim7: E788 is too restrictive

2006-05-31 Thread Hari Krishna Dara

On Wed, 31 May 2006 at 8:26pm, Christian J. Robinson wrote:

> Today (Wed, 31 May 2006), Hari Krishna Dara wrote:
>
> > It seems like I am getting E788 error too often, without much
> > reason.  The latest is for the :compiler command that is being
> > executed from a ftplugin.
> [...]
>
> I get this error as well.  There really needs to be some kind of
> compromise--I'm only forcing a reload of the current buffer when I'm
> trying to modify a readonly RCS controlled file.  The documentation
> claims this is allowed but Vim7 trips all over itself.
>
> - Christian

The handling of FileChangedRO was never smooth for me. As a workaround,
I am thinking of avoiding a reload altogether and just mark the buffer
as 'noro'. I relied upon the reload for its side effects before, but I
should be able to force them directly, so all I can think of that needs
to be done after a successful checkout is to mark the buffer as
non-readonly. Any comments?

-- 
Thanks,
Hari

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


RE: Copying everything (not the complete line, only the matching pattern) which matches a pattern

2006-05-31 Thread SHANKAR R-R66203
This is assuming that the each line has only one matching pattern.
After hit and trial I have used the macro to do that.
But want to have some cute solution.

Regards,
Shankar


>
>Hi Shankar,
>
>1. Get the pattern matching lines in a separate buffer
>:g//t$
>
>2.
>:%s/^.*\(\).*$/\1/
>
>
>~VIshhu
>
>-Original Message-
>From: SHANKAR R-R66203 [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 31, 2006 4:06 PM
>To: 'Vishnu'
>Cc: vim@vim.org
>Subject: RE: Copying everything (not the complete line, only the
>matching pattern) which matches a pattern
>
>This will copy the entire line.
>I do not want to copy the entire line, but just the pattern.
>
>Regards,
>Shankar
>
>
>
>>-Original Message-
>>From: Vishnu [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, May 31, 2006 3:53 PM
>>To: SHANKAR R-R66203
>>Cc: vim@vim.org
>>Subject: RE: Copying everything which matches a pattern
>>
>>Hi Shankar,
>>
>>
>>:g//t$
>>
>>t - copy to address $
>>
>>
>>you can call function instead of t$
>>
>>~Vishnu
>>
>>
>>-Original Message-
>>From: SHANKAR R-R66203 [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, May 31, 2006 3:41 PM
>>To: 'vim@vim.org'
>>Subject: Copying everything which matches a pattern
>>
>>
>>Hi Vimmers,
>>
>>   I want to copy everything that matches a search pattern.
>>
>>For example, if my search pattern is
>>
>>/\$.*s
>>
>>I want to copy all the patterns that matches this into a buffer.
>>
>>How can I do this ?
>>
>>Regards,
>>Shankar


tabedit breaks context menu file loads.

2006-05-31 Thread Bos, Eric \(Contractor\)
I just installed vim70 on winxp, and am exploring it. 

I like the :tabedit functionality, but if I place it in my vimrc file,
then opening a file with the contex menu no longer works - I get an
empty file, and I have to click on the correct tab and type :e to get
the file to show. Any ideas? 


Eric Bos, Contractor (Software Development).
SLEW Group, EWRD, DSTO Edinburgh, South Australia
Ph 8259-4264, Mob 041 8388 547

IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
CRIMES ACT 1914. If you have received this email in error, you are
requested to contact the sender and delete the email.


Re: put (paste) from windows clipboard into vim

2006-05-31 Thread A.J.Mechelynck

Evan H. Carmi wrote:

hey all,

i am wondering how to copy through windows and than paste into vim with
a keyboard command.

for example: i am running FF and i copy some text, when i go into vim I
don't know how to put (paste) that text without right clicking and
selecting paste. the

:p

command doesn't work and seems to be put what is in the vim clipboard (i
don't think clipboard is the correct term for the place where vim has
yanked data. what is it?)

peace, Evan


  
In Vim, the system clipboard is known as "register plus". On non-Unix 
versions, "register star" is synonymous with it. So, just prefix your P 
(put) command with "+ (double-quote plus) or, on non-Unix systems, by "* 
(double-quote star) and voilà! The clipboard contents get patsed. 
Conversely, "+y or "+d do a yank (copy) or delete (cut) to the clipboard:


   "+p   paste before cursor
   "+P   paste after cursor
   "+y   copy (visual area, or takes a postfix telling Vim 
"what" to copy)

   "+d   cut (visual area, or with a postfix)

   :echo @+ show the contents of the system clipboard _without_ 
pasting


etc.

And BTW, it's p (put after cursor) or P (put before cursor), _without_ a 
colon prefix; or you can youse the :pu[t] command, which takes the 
register-name after the command, and accepts a line number:


   :put +

pastes the clipboard after the current line, and

   :0put +

pastes it at the top of the file (or use ":$put +", without the quotes, 
to paste at the bottom).


And the correct name (in Vim lingo) for where Vim stores data between a 
yank and a put if you don't explicitly specify a register name, is -- 
the unnamed register.


See ":help change.txt", and, in particular, ":help registers".


HTH,
Tony.


Re: vim7: E788 is too restrictive

2006-05-31 Thread Christian J. Robinson
Today (Wed, 31 May 2006), Hari Krishna Dara wrote:

> It seems like I am getting E788 error too often, without much
> reason.  The latest is for the :compiler command that is being
> executed from a ftplugin.
[...]

I get this error as well.  There really needs to be some kind of
compromise--I'm only forcing a reload of the current buffer when I'm
trying to modify a readonly RCS controlled file.  The documentation
claims this is allowed but Vim7 trips all over itself.

- Christian

-- 
You get a democracy when three wolves and a sheep vote on what to
 have for dinner.
Christian J. Robinson <[EMAIL PROTECTED]> http://infynity.spodzone.com/
   PGP keys: 0x893B0EAF / 0xFB698360   http://infynity.spodzone.com/pgp


put (paste) from windows clipboard into vim

2006-05-31 Thread Evan H. Carmi
hey all,

i am wondering how to copy through windows and than paste into vim with
a keyboard command.

for example: i am running FF and i copy some text, when i go into vim I
don't know how to put (paste) that text without right clicking and
selecting paste. the

:p

command doesn't work and seems to be put what is in the vim clipboard (i
don't think clipboard is the correct term for the place where vim has
yanked data. what is it?)

peace, Evan


Re: Problem with OmniCompletion

2006-05-31 Thread A.J.Mechelynck

Bos, Eric (Contractor) wrote:
I just tried omnicompletion for the first time (vim70 on winXP). 


In a C++ file, I entered mC, and it started looking fo r things starting
with capital M, i.e. MC. This is a problem in itself since C++ is case
sensitivie.

Mor annoyingly, I hit delete to go back to that 'M' and make it an 'm'.
Vim then went into an endless loop trying to list everything in my sytem
starting with 'M'. I have 250,000 lines of code indexed via ctags (I
presume completion uses the same mechanism as the tags functionality). 


In any case, after looking at a frozen vim for a few minutes, I realised
it was never going to come back to me. At that stage even killing vim
was hard. I really think this needs looking at. 

Cheers.  


Eric Bos, Contractor (Software Development).
SLEW Group, EWRD, DSTO Edinburgh, South Australia Ph 8259-4264, Mob 041
8388 547

IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
CRIMES ACT 1914. If you have received this email in error, you are
requested to contact the sender and delete the email.



  
I'm not very familiar with this aspect of omni-completion; but are you 
sure you have 'ignorecase' off? To check it, make your C++ file active 
(move the cursor to it) and enter


:verbose set ignorecase?

Vim should answer "noignorecase" and the place (if any) where the option 
was last changed. Don't forget the question mark at the end, otherwise 
you would set 'ignorecase' unconditionally ON.



Best regards,
Tony.


Problem with OmniCompletion

2006-05-31 Thread Bos, Eric \(Contractor\)
Hi, I just tried omnicompletion for the first time (vim70 on winXP). 

In a C++ file, I entered mC, and it started looking for things starting
with capital M, i.e. MC. This is a problem in itself since C++ is case
sensitive.

More annoyingly, I hit delete to go back to that 'M' and make it an 'm'.
Vim then went into an endless loop trying to list everything in my sytem
starting with 'M'. I have 250,000 lines of code indexed via ctags (I
presume completion uses the same mechanism as the tags functionality). 

In any case, after looking at a frozen vim for a few minutes, I realised
it was never going to come back to me. At that stage even killing vim
was hard. I really think this needs looking at. 

Cheers.  

Eric Bos, Contractor (Software Development).
SLEW Group, EWRD, DSTO Edinburgh, South Australia Ph 8259-4264, Mob 041
8388 547

IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
CRIMES ACT 1914. If you have received this email in error, you are
requested to contact the sender and delete the email.



Problem with OmniCompletion

2006-05-31 Thread Bos, Eric \(Contractor\)
I just tried omnicompletion for the first time (vim70 on winXP). 

In a C++ file, I entered mC, and it started looking fo r things starting
with capital M, i.e. MC. This is a problem in itself since C++ is case
sensitivie.

Mor annoyingly, I hit delete to go back to that 'M' and make it an 'm'.
Vim then went into an endless loop trying to list everything in my sytem
starting with 'M'. I have 250,000 lines of code indexed via ctags (I
presume completion uses the same mechanism as the tags functionality). 

In any case, after looking at a frozen vim for a few minutes, I realised
it was never going to come back to me. At that stage even killing vim
was hard. I really think this needs looking at. 

Cheers.  

Eric Bos, Contractor (Software Development).
SLEW Group, EWRD, DSTO Edinburgh, South Australia Ph 8259-4264, Mob 041
8388 547

IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
CRIMES ACT 1914. If you have received this email in error, you are
requested to contact the sender and delete the email.


vim7: E788 is too restrictive

2006-05-31 Thread Hari Krishna Dara

It seems like I am getting E788 error too often, without much reason.
The latest is for the :compiler command that is being executed from a
ftplugin. I narrowed it down to the command itself, not the compiler
plugin, as adding a :finish at the start of the compiler plugin didn't
get rid off the error, but commenting the :compiler call itself did.

The problem occurs because I am reloading the buffer during the
FileChangedRO event, and manually triggering the BufRead event, because
for some reason this doesn't get triggered. Actually BufRead event
didn't in prior version also, but I was able to workaround this by
manually triggering FileChangedShell (Bram's suggestion), but this no
longer works properly. If FileChangedShell is triggered from
FileChangedRO, the v:fcs_reason gets ignored, so my workaround is to
just reload the file, and manually fire BufRead event, which is what is
causing the E788 error in this case.

The previous time I got E788 was in my FileChangedShell handler. Prior
to 7.0, since there was no v:fcs_reason support, I had to jump to the
buffer for which the event got triggered and conditionally reload the
buffer, but now this is no longer allowed. The reason I think this is
too restrictive is that the doc suggests that FileChangedShell is
allowed to reload related buffers, if you know what you are doing, but
you can't reload buffer without first switching to it (and, to repeat,
this causes E788).

-- 
Thanks,
Hari

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


Re: Inserting text in front of multiple marked lines

2006-05-31 Thread Gary Johnson
On 2006-05-31, Matthias Pitzl <[EMAIL PROTECTED]> wrote:

> Tim Chase wrote:
> > > Perhaps this is a simple question but i'm a bit confused.
> > > If i mark several lines with shift+v and then use shift+i
> > > to insert in front of the line, the text entered is just
> > > placed in front of the first marked line. How can i easily
> > > add text to all marked lines?
> >
> > It sounds like you're trying to do something allowed by
> > blockwise visual mode from within linewise visual mode.  As
> > you've found, it doesn't work in linewise. :)
> >
> > You can either select the range in blockwise mode (using
> > ^V), or you can use an ex command.
> >
> > To learn more about the blockwise functionality, you can
> > read at
> >
> > :help blockwise-operators
> >
> > If you want to insert text at the beginning of a range of
> > lines, you can use
> >
> > :'<,'>s/^/text to insert
> >
> > If you have disjoint lines that can be found by a regexp,
> > you can use
> >
> > :g/regexp/s/^/text to insert
> >
> > Often, for me, this "text to insert" is a "comment to end
> > of line" specifier such as a "#" or "//".
> >
> > Just a few ideas,

> Thank you for the fast answer Tim :)
> I'll take a look onto these help pages. The possibility with s/.../.../
> i knew but i thought there has to be something easier ;)

There is.  You were close with your first try; you just missed a 
step.  Mark the lines with shift+v, then type ctrl+v to change from 
linewise to blockwise, then type shift+i and type your text.  When 
you then type escape, each line will have your text inserted in 
front of it.

Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


Re: Vim and the numeric keypad mapping

2006-05-31 Thread A.J.Mechelynck

A.J.Mechelynck wrote:

Amanda Esparza wrote:

Hello,
 I am a new user to VIM, I have been a UNIX VI user for 5-6 years.

My question is:  How do I get VIM to recognize and use my numeric key 
pad?

I found some documentation in the FAQ, however I am not sure "that the
numeric keypad keys are passed to Vim."  So the FAQ answered part of
question, but I am still having a hard time getting my head around 
the exact
steps I need to follow in order to get my numeric key pad to work 
while in

Vim.  When I tried, I got the following error: E21: Cannot make changes,
'modifiable' is off
Can someone help me get this to work?  I would appreciate any help 
someone

can provide. thank you!!

20.5. How do I map the numeric keypad keys? First make sure that the 
numeric
keypad keys are passed to Vim. Next, you can use the following 
command to map the numeric keypad keys: :map  
 where,  can be kHome, kEnd, kPageUp, 
kPageDown, kPlus, kMinus,
kDivide, kMultiply, kEnter, etc. For more information, read :help 
key-codes :help terminal-options


 



  
Normally, the keypad keys are equivalent to the equivalent non-keypad 
keys:


   , , , , , , , , 
etc.


You can insert the above and similar <> names in the {lhs} and/or 
{rhs} of mappings.


I wouldn't advise you to try to map the grey Left key differently than 
the non-NumLock 4, Right differently than non-NumLock 6, etc. I think 
there has been a change in how they are related to each other in Vim 7 
compared to Vim 6.


To see if a given keyhit or key combo is seen by Vim and how:

1. Open a [No Name] buffer and set it to Insert mode.
2. Hit Ctrl-V (or Ctrk-Q if you use Ctrl-V to paste) followed by the 
key (or key combo) in question.


If Vim sees it, the characters it receives (or, for special keys, the 
<> name of the key) will be inserted into the buffer. If Vim doesn't 
see it, then (if 'showcmd' is on) ^V will remain displayed near the 
right end of the command-line. Hit the spacebar to insert a space, 
make the ^V prefix disappear, and return to "normal" Insert mode.


3. When you're finished with it, return to Normal mode and use ":q" or 
":enew" to leave the temporary buffer.


See
   :help key-notation
  and what follows it up to, and not including, section 5 "Modes, 
introduction"

   :help :map-special-keys
  and what follows it until 1.8 "Examples"
   :help i_CTRL-V


Best regards,
Tony.


Oops! To abandon (q.v.) the temporary buffer, you'll need a command with 
a bang, as in ":q!" or ":enew!"


Best regards,
Tony.


Re: Vim and the numeric keypad mapping

2006-05-31 Thread A.J.Mechelynck

Amanda Esparza wrote:

Hello,
 I am a new user to VIM, I have been a UNIX VI user for 5-6 years.

My question is:  How do I get VIM to recognize and use my numeric key pad?
I found some documentation in the FAQ, however I am not sure "that the
numeric keypad keys are passed to Vim."  So the FAQ answered part of
question, but I am still having a hard time getting my head around the exact
steps I need to follow in order to get my numeric key pad to work while in
Vim.  When I tried, I got the following error: E21: Cannot make changes,
'modifiable' is off
Can someone help me get this to work?  I would appreciate any help someone
can provide. 
thank you!!


20.5. How do I map the numeric keypad keys? First make sure that the numeric
keypad keys are passed to Vim. 
Next, you can use the following command to map the numeric keypad keys: 
:map   
where,  can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus,
kDivide, kMultiply, kEnter, etc. 
For more information, read 
:help key-codes 
:help terminal-options 



 



  

Normally, the keypad keys are equivalent to the equivalent non-keypad keys:

   , , , , , , , , etc.

You can insert the above and similar <> names in the {lhs} and/or {rhs} 
of mappings.


I wouldn't advise you to try to map the grey Left key differently than 
the non-NumLock 4, Right differently than non-NumLock 6, etc. I think 
there has been a change in how they are related to each other in Vim 7 
compared to Vim 6.


To see if a given keyhit or key combo is seen by Vim and how:

1. Open a [No Name] buffer and set it to Insert mode.
2. Hit Ctrl-V (or Ctrk-Q if you use Ctrl-V to paste) followed by the key 
(or key combo) in question.


If Vim sees it, the characters it receives (or, for special keys, the <> 
name of the key) will be inserted into the buffer. If Vim doesn't see 
it, then (if 'showcmd' is on) ^V will remain displayed near the right 
end of the command-line. Hit the spacebar to insert a space, make the ^V 
prefix disappear, and return to "normal" Insert mode.


3. When you're finished with it, return to Normal mode and use ":q" or 
":enew" to leave the temporary buffer.


See
   :help key-notation
  and what follows it up to, and not including, section 5 "Modes, 
introduction"

   :help :map-special-keys
  and what follows it until 1.8 "Examples"
   :help i_CTRL-V


Best regards,
Tony.


Re: How to keep tabs and buffers between Vim session

2006-05-31 Thread Jeremy Conlin

On 5/31/06, Arnaud Schmittbuhl <[EMAIL PROTECTED]> wrote:

On Wed, 31 May 2006 14:43:58 -0400
"Jeremy Conlin" <[EMAIL PROTECTED]> wrote:

> I have been working on many files in gvim spread over many tabs and
> windows.  I like this setup and would like to return to it after I
> close gvim.  Is there any way to keep the gvim state for the next
> time?

Hi,

To save your session,
:mksession filename

To restore your session,
:source filename

--
Arnaud Schmittbuhl
Montpellier, France


Wonderful!  Thanks a bunch.  I guess I just needed to know to search
for "session" in the vim help.
Jeremy


Re: Inserting text in front of multiple marked lines

2006-05-31 Thread Matthias Pitzl
Thank you for the fast answer Tim :)
I'll take a look onto these help pages. The possibility with s/.../.../
i knew but i thought there has to be something easier ;)

- Matthias

Tim Chase wrote:
> > Perhaps this is a simple question but i'm a bit confused.
> > If i mark several lines with shift+v and then use shift+i
> > to insert in front of the line, the text entered is just
> > placed in front of the first marked line. How can i easily
> > add text to all marked lines?
>
> It sounds like you're trying to do something allowed by
> blockwise visual mode from within linewise visual mode.  As
> you've found, it doesn't work in linewise. :)
>
> You can either select the range in blockwise mode (using
> ^V), or you can use an ex command.
>
> To learn more about the blockwise functionality, you can
> read at
>
> :help blockwise-operators
>
> If you want to insert text at the beginning of a range of
> lines, you can use
>
> :'<,'>s/^/text to insert
>
> If you have disjoint lines that can be found by a regexp,
> you can use
>
> :g/regexp/s/^/text to insert
>
> Often, for me, this "text to insert" is a "comment to end
> of line" specifier such as a "#" or "//".
>
> Just a few ideas,
>
> -tim
>
>
>
>
>


Re: Inserting text in front of multiple marked lines

2006-05-31 Thread Tim Chase

> Perhaps this is a simple question but i'm a bit confused.
> If i mark several lines with shift+v and then use shift+i
> to insert in front of the line, the text entered is just
> placed in front of the first marked line. How can i easily
> add text to all marked lines?

It sounds like you're trying to do something allowed by
blockwise visual mode from within linewise visual mode.  As
you've found, it doesn't work in linewise. :)

You can either select the range in blockwise mode (using
^V), or you can use an ex command.

To learn more about the blockwise functionality, you can
read at

:help blockwise-operators

If you want to insert text at the beginning of a range of
lines, you can use

:'<,'>s/^/text to insert

If you have disjoint lines that can be found by a regexp,
you can use

:g/regexp/s/^/text to insert

Often, for me, this "text to insert" is a "comment to end
of line" specifier such as a "#" or "//".

Just a few ideas,

-tim








Inserting text in front of multiple marked lines

2006-05-31 Thread Matthias Pitzl
Hello all!

Perhaps this is a simple question but i'm a bit confused. If i mark
several lines with shift+v and then use shift+i to insert in front of
the line, the text entered is just placed in front of the first marked
line. How can i easily add text to all marked lines?
Thank you for your help!

Sincerly,
Matthias



Re: How to keep tabs and buffers between Vim session

2006-05-31 Thread William O'Higgins Witteman
On Wed, May 31, 2006 at 08:55:59PM +0200, Arnaud Schmittbuhl wrote:
>"Jeremy Conlin" <[EMAIL PROTECTED]> wrote:
>
>> I have been working on many files in gvim spread over many tabs and
>> windows.  I like this setup and would like to return to it after I
>> close gvim.  Is there any way to keep the gvim state for the next
>> time?  
>
>To save your session, 
>:mksession filename
>
>To restore your session,
>:source filename

To further ease this process you could look into the autosession plugin:

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

I'm not certain that it works with Vim 7, but it is quite short and easy
to understand and would, with the help of :help mksession, put you on a
path to your happy place.
-- 

yours,

William


Re: :vimgrep on all buffers

2006-05-31 Thread Eric Arnold

On 5/31/06, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:

Hi,

On 5/31/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
> How about
>
> set errorformat+=%f,%f:%m,%f:%l:%m
>
> command! -nargs=* Bufgrep silent! bufdo! g//caddexpr expand("%")
> . ":" . line(".") .  ":" . getline(".")
>
> It does have a problem where it tries to open the first entry
> automatically, but it opens the line contents instead of the buffer
> name, but it does the right thing otherwise.  Hmm, weird.
>

The ":caddexpr" command will not jump to the first entry.

The ":bufdo"  command loads all the buffers and runs the specified
command. When the ":bufdo" command completes, the last buffer will
be displayed in the current window.

When the ":g" command completes the cursor will be positioned on the
last matching pattern.

So when you execute the ":Bufgrep" command, the cursor will be
positioned on the last matching pattern position in the last buffer.

- Yegappan



Unfortunately, what it was doing was not leaving at the last buffer,
but trying to open buffers with the names comprised of the matched
line contents.

However, I've quit that gvim process, and it won't happen in the new
gvim process, so I guess I'll deal with it if it comes back.


Vim and the numeric keypad mapping

2006-05-31 Thread Amanda Esparza
Hello,
 I am a new user to VIM, I have been a UNIX VI user for 5-6 years.

My question is:  How do I get VIM to recognize and use my numeric key pad?
I found some documentation in the FAQ, however I am not sure "that the
numeric keypad keys are passed to Vim."  So the FAQ answered part of
question, but I am still having a hard time getting my head around the exact
steps I need to follow in order to get my numeric key pad to work while in
Vim.  When I tried, I got the following error: E21: Cannot make changes,
'modifiable' is off
Can someone help me get this to work?  I would appreciate any help someone
can provide. 
thank you!!

20.5. How do I map the numeric keypad keys? First make sure that the numeric
keypad keys are passed to Vim. 
Next, you can use the following command to map the numeric keypad keys: 
:map   
where,  can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus,
kDivide, kMultiply, kEnter, etc. 
For more information, read 
:help key-codes 
:help terminal-options 


 


Re: How to keep tabs and buffers between Vim session

2006-05-31 Thread Arnaud Schmittbuhl
On Wed, 31 May 2006 14:43:58 -0400
"Jeremy Conlin" <[EMAIL PROTECTED]> wrote:

> I have been working on many files in gvim spread over many tabs and
> windows.  I like this setup and would like to return to it after I
> close gvim.  Is there any way to keep the gvim state for the next
> time?  

Hi,

To save your session, 
:mksession filename

To restore your session,
:source filename

-- 
Arnaud Schmittbuhl
Montpellier, France


How to keep tabs and buffers between Vim session

2006-05-31 Thread Jeremy Conlin

I have been working on many files in gvim spread over many tabs and
windows.  I like this setup and would like to return to it after I
close gvim.  Is there any way to keep the gvim state for the next
time?  I thought this was called persistence, but couldn't find
anything about it.
Thanks,
Jeremy


Re: :vimgrep on all buffers

2006-05-31 Thread Yegappan Lakshmanan

Hi,

On 5/31/06, Eric Arnold <[EMAIL PROTECTED]> wrote:

How about

set errorformat+=%f,%f:%m,%f:%l:%m

command! -nargs=* Bufgrep silent! bufdo! g//caddexpr expand("%")
. ":" . line(".") .  ":" . getline(".")

It does have a problem where it tries to open the first entry
automatically, but it opens the line contents instead of the buffer
name, but it does the right thing otherwise.  Hmm, weird.



The ":caddexpr" command will not jump to the first entry.

The ":bufdo"  command loads all the buffers and runs the specified
command. When the ":bufdo" command completes, the last buffer will
be displayed in the current window.

When the ":g" command completes the cursor will be positioned on the
last matching pattern.

So when you execute the ":Bufgrep" command, the cursor will be
positioned on the last matching pattern position in the last buffer.

- Yegappan


Re: Copying everything (not the complete line, only the matching pattern) which matches a pattern

2006-05-31 Thread Benji Fisher
 It depends on what you mean by a buffer.  The basic idea of using
:g should work, and there are a lot of different ways to use it.  For
example,

:let @a = ""
:g/\http://www.vim.org/script.php?script_id=72

HTH --Benji Fisher

On Wed, May 31, 2006 at 04:06:20PM +0530, SHANKAR R-R66203 wrote:
> This will copy the entire line.
> I do not want to copy the entire line, but just the pattern.
> 
> >-Original Message-
> >From: Vishnu [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, May 31, 2006 3:53 PM
> >
> >Hi Shankar,
> >
> >
> >:g//t$
> >
> >t - copy to address $
> >
> >
> >you can call function instead of t$
> >
> >-Original Message-
> >From: SHANKAR R-R66203 [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, May 31, 2006 3:41 PM
> >
> >Hi Vimmers,
> >
> >   I want to copy everything that matches a search pattern.
> >
> >For example, if my search pattern is
> >
> >/\$.*s
> >
> >I want to copy all the patterns that matches this into a buffer.
> >
> >How can I do this ?


Re: execute macro in bufdo command

2006-05-31 Thread Eric Arnold

On 5/31/06, Eric Arnold <[EMAIL PROTECTED]> wrote:

On 5/31/06, Johannes Schwarz <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I recorded a macro (search for line and paste 3 lines out of the
> clipboard"*p  )
>
> I want to execute the macro in 15 different buffers and tried it with
> the bufdo - Command, without success
>
> :bufdo  @a | update

Try

bufdo  normal @a

@a in  :ex  doesn't mean 'execute'.


Hmm.  Well, I don't think it means 'execute keystrokes', correct if wrong.



> Vim prints 30 lines (every first line the filename and every second
> line the search-criterium), then it waits for me pressing a key.
> But nothing changed in the files.
>
> Does someone can give me a hint?
>



Re: execute macro in bufdo command

2006-05-31 Thread Tim Chase

I recorded a macro (search for line and paste 3 lines out of the
clipboard"*p  )


Without the contents of the macro, this may be a bit difficult to 
troubleshoot.



:bufdo  @a | update


You likely want

:bufdo norm @a

However, "norm" doesn't allow extra stuff after it (such as your 
update).  My preferred way to make such batch changes is to 
enable the 'hidden' setting, allowing me to review all the 
changes before updating them all with ":wall"


From the description of what you want to do, you can also do it 
in ex mode:


:set hidden
:bufdo g/regexp/put *
[review changes]
:wall

This will put the clipboard's contents after *every* line 
containing regexp.  If you only want the first, you can use


:set hidden wrapscan
:bufdo $/regexp/put *

Hope this gives you some stuff to work with.

-tim






Re: execute macro in bufdo command

2006-05-31 Thread Eric Arnold

On 5/31/06, Johannes Schwarz <[EMAIL PROTECTED]> wrote:

Hi all,

I recorded a macro (search for line and paste 3 lines out of the
clipboard"*p  )

I want to execute the macro in 15 different buffers and tried it with
the bufdo - Command, without success

:bufdo  @a | update


Try

bufdo  normal @a

@a in  :ex  doesn't mean 'execute'.



Vim prints 30 lines (every first line the filename and every second
line the search-criterium), then it waits for me pressing a key.
But nothing changed in the files.

Does someone can give me a hint?



execute macro in bufdo command

2006-05-31 Thread Johannes Schwarz
Hi all,

I recorded a macro (search for line and paste 3 lines out of the
clipboard"*p  )

I want to execute the macro in 15 different buffers and tried it with
the bufdo - Command, without success

:bufdo  @a | update

Vim prints 30 lines (every first line the filename and every second
line the search-criterium), then it waits for me pressing a key. 
But nothing changed in the files.

Does someone can give me a hint?


Re: gvim 7.0 does not display files in the same directory again

2006-05-31 Thread Charles E Campbell Jr

PoWah Wong wrote:


When I use gvim to open files, the first time it will display all the files in 
the directory A.
After I open a file, when I try to open files in the same directory A,  
it does not display any files, i.e. the directory A is displayed as empty.

I have to display the files in another directory B (e.g. parent directory), 
then it will display all the files in the directory A.
gvim version is 7.0.  I download source code and compiled it.
Linux is Red Hat 7.2 (2.4.7-10smp).
 

I generally use Fedora Core 4; I doubt that Red Hat 7.2 acts that much 
differently.  So, please give the

commands you actually use.

For example:

 gvim .
 (select a file) 
 :e .

which, by the way, works for me.  If that sequence isn't working for 
you, then you'll need to consider
the settings you're using.  Try commenting out all such settings (except 
set nocp) and determine which

one, if any, is causing problems.

Regards,
Chip Campbell



Re: Syntax Highlighting: Vim 7, Debian

2006-05-31 Thread Chisum Lindauer

Gregory Margo wrote:


On Tue, May 30, 2006 at 02:44:17PM -0400, Chisum Lindauer wrote:
 

Hello all I've just worked on trying to get this to work a few hours 
with no luck, so I thought I'd consult the community.


In short, my syntax highlighting doesn't work.  Not in vim or vim 
-g/gvim.  I've tried the easy things like :snytax enable or :syntax on 
and manually loading a colorscheme but to no effect.

I recently did an apt-get upgrade which broke my X install.
Once I had fixed that and returned to the world of GUI's I found my 
syntax highlighting didn't work.  The color test shows all the colors 
properly however. (Select it from the syntax menu in gvim).
At first I thought it might be because of my terminal, but changing that 
using tset and/or setting my TERM environment variable to xterm-color 
helped not in the least.  It's not just a color problem anyhow, as bold 
and italics don't work on syntax either.  It's not a colorscheme bug 
either, as I've tried using several colorschemes and get the same 
results (though it will change the bgcolor an fgcolor in gvim).


I tried removing and reinstalling gvim as well, but the problem 
persists.  Needless to say, now that I'm used to syntax highlighting 
being without it feels like losing an arm.


The only error message I've ever seen regarding the syntax is when I 
opened up gvim and select on/off for This file under the syntax menu, it 
tells me that my colorscheme can not be found when parsing 
syntax/synload.vim.  This error doesn't happen except when I first load 
vim, and only if I don't change the colorscheme before hand.  This might 
be a clue for someone, but probably not.


Also if I log into our server ssh -X and use gvim over the network, 
syntax highlighting does work, of course, that doesn't say a damn thing 
either.  It just makes me think that it's probably a configuration file 
of some sort...


I hope someone has an idea, I sure as hell don't.
Thanks,
Chisum Lindauer
   



If you have both vim-6 and vim-7 installed, there may be a conflict,
especially if you try to share a ~/.vim directory.  I'm running under
Debian Stable, and have the default vim-6.3.82 installed, and have a
locally compiled vim-7.0.15 installed also (with binary name 'vim7').
Syntax highlighting works find under either.  However,
I've kept them seperated with different .vimrc files, and different
'runtimepath' variables.

Try this: in an xterm (version 4.3.0.dfsg.1-14sarge1) run
"/path/to/your/vim7 -u NONE".

Now type ":help" - you should see black-n-white help text.
Now type ":syntax on" - you should see the help with syntax highlighting.

If does not work, it could be the color settings of the xterm itself.

Since you mentioned breaking your X setup, could it be that you're
running a bleeding edge Debian Unstable (etch) system?

 

Just letting everyone know that I got it working finally.  I purged the 
apt-get vim packages, deleted my own .vimrc and .gvimrc files and 
installed from source (though it said I had no terminal library so I 
installed ncurses from source as well).


I think it was a combination of issues, in part it was because I had 
messed with the config files before and I think something was wrong with 
my .vimrc and .gvimrc files, in addition I don't think it had the 
terminal support it needed (as even under different users with default 
.vimrc and .gvimrc files the problem persisted before).  Thank you all 
for  your help :)  vim -u NONE is quite handy, and I learned more about 
vim and debian to boot.


Thank You,
Chisum Lindauer


gvim 7.0 does not display files in the same directory again

2006-05-31 Thread PoWah Wong
When I use gvim to open files, the first time it will display all the files in 
the directory A.
 After I open a file, when I try to open files in the same directory A,  
 it does not display any files, i.e. the directory A is displayed as empty.
 I have to display the files in another directory B (e.g. parent directory), 
then it will display all the files in the directory A.
 gvim version is 7.0.  I download source code and compiled it.
 Linux is Red Hat 7.2 (2.4.7-10smp).



Re: :vimgrep on all buffers

2006-05-31 Thread Bob Hiestand

On 5/31/06, Eric Arnold <[EMAIL PROTECTED]> wrote:

On 5/31/06, Cory Echols <[EMAIL PROTECTED]> wrote:
> On 5/31/06, Bernhard Leiner <[EMAIL PROTECTED]> wrote:
> > Hi!
> >
> > I'm looking for a good soultion to to search for a keyword in all open 
buffers.
> >
> > Using the :bufdo command to search in all buffers basically does what
> > I want but the output isn't very useable. Using :vimgrep on multiple
> > _files_ with its output in the quickfix window is much better but
> > works only on files.
> >
> > Sombody has an idea?
>
> Like most vim commands, if you use '%' as the file name argument to a
> vimgrep command, it will expand to the filename of the current buffer.
>  This means you can use:
>
> :bufdo vimgrepadd /pattern/ %
>
> The catch is that 'vimgrepadd' *adds* matches to the current match
> list.  If there's already entries in it, they'll be added to instead
> of replaced.  I couldn't find any command that would clear the current

:cex ''

works.


> quickfix list, so I suppose you'd have to search for an unmatchable
> pattern to clear it.  Try 200 x's anchored at the beginning of a line
> in the current buffer.  Another catch is that I couldn't get :vimgrep
> to accept a '|' command separator, so you have to do them in two
> steps.
>
> :vimgrep /\v^x{200}/ %
> :bufdo vimgrepadd /pattern/ %
>

I guess you'll have to make a function instead of using "|" for
commands like this.


I think vimgrep can be followed by '|', but the error interrupts the
command.  You could do something like:

:silent! vimgrep /\v^x{200}/ % | bufdo vimgrepadd /pattern/ %

For commands that really don't allow '|' for chaining other commands,
you can use ':execute' to do so in some cases:

:execute 'silent! vimgrep /\v^x{200}/ %' | bufdo vimgrepadd /pattern/ %

Thanks,

bob


Re: :vimgrep on all buffers

2006-05-31 Thread Eric Arnold

On 5/31/06, Cory Echols <[EMAIL PROTECTED]> wrote:

On 5/31/06, Bernhard Leiner <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I'm looking for a good soultion to to search for a keyword in all open 
buffers.
>
> Using the :bufdo command to search in all buffers basically does what
> I want but the output isn't very useable. Using :vimgrep on multiple
> _files_ with its output in the quickfix window is much better but
> works only on files.
>
> Sombody has an idea?

Like most vim commands, if you use '%' as the file name argument to a
vimgrep command, it will expand to the filename of the current buffer.
 This means you can use:

:bufdo vimgrepadd /pattern/ %

The catch is that 'vimgrepadd' *adds* matches to the current match
list.  If there's already entries in it, they'll be added to instead
of replaced.  I couldn't find any command that would clear the current


:cex ''

works.



quickfix list, so I suppose you'd have to search for an unmatchable
pattern to clear it.  Try 200 x's anchored at the beginning of a line
in the current buffer.  Another catch is that I couldn't get :vimgrep
to accept a '|' command separator, so you have to do them in two
steps.

:vimgrep /\v^x{200}/ %
:bufdo vimgrepadd /pattern/ %



I guess you'll have to make a function instead of using "|" for
commands like this.


Re: :vimgrep on all buffers

2006-05-31 Thread Eric Arnold

How about

set errorformat+=%f,%f:%m,%f:%l:%m

command! -nargs=* Bufgrep silent! bufdo! g//caddexpr expand("%")
. ":" . line(".") .  ":" . getline(".")

It does have a problem where it tries to open the first entry
automatically, but it opens the line contents instead of the buffer
name, but it does the right thing otherwise.  Hmm, weird.



On 5/31/06, Bernhard Leiner <[EMAIL PROTECTED]> wrote:

Hi!

I'm looking for a good soultion to to search for a keyword in all open buffers.

Using the :bufdo command to search in all buffers basically does what
I want but the output isn't very useable. Using :vimgrep on multiple
_files_ with its output in the quickfix window is much better but
works only on files.

Sombody has an idea?

regards,
bernhard



Re: Syntax Highlighting: Vim 7, perl not working

2006-05-31 Thread Chisum Lindauer

Gregory Margo wrote:


On Tue, May 30, 2006 at 07:21:47PM -0400, Jack Donohue wrote:
 

Just started using vim7, quite happy so far.  Major problem is that syntax 
highlighting doesn't work for *.pl files.


I see filetype=conf rather than perl, which I don't understand.

Here are the scripts loaded:

1: c:/vim/_vimrc
2: c:/vim/vimfiles/plugin/SpellChecker.vim
3: c:/vim/vimfiles/plugin/ccase.vim
4: c:/vim/vimfiles/plugin/closetag.vim
5: c:/vim/vimfiles/plugin/matchit.vim
6: c:/vim/vimfiles/plugin/mru.vim
7: c:/vim/_vim_mru_list
8: c:/vim/vimfiles/plugin/taglist.vim
9: c:/vim/vimfiles/plugin/TagsMenu.vim
10: c:/vim/vim70/plugin/getscript.vim
11: c:/vim/vim70/plugin/gzip.vim
12: c:/vim/vim70/plugin/matchparen.vim
13: c:/vim/vim70/plugin/netrwPlugin.vim
14: c:/vim/vim70/plugin/rrhelper.vim
15: c:/vim/vim70/plugin/spellfile.vim
16: c:/vim/vim70/plugin/tarPlugin.vim
17: c:/vim/vim70/plugin/tohtml.vim
18: c:/vim/vim70/plugin/vimballPlugin.vim
19: c:/vim/vim70/plugin/zipPlugin.vim
20: c:/vim/vim70/menu.vim
21: c:/vim/vim70/autoload/paste.vim
22: c:/vim/_gvimrc
23: c:/vim/abbreviations.vim
24: c:/vim/vim70/syntax/syntax.vim
25: c:/vim/vim70/syntax/synload.vim
26: c:/vim/vim70/syntax/syncolor.vim
27: c:/vim/vim70/filetype.vim
28: c:/vim/vim70/ftplugin.vim
29: c:/vim/vim70/indent.vim
30: c:/vim/jmd.vim
31: c:/vim/vim70/syntax/perl.vim
32: c:/vim/vimfiles/ftplugin/perl_jmd.vim
33: c:/vim/vim70/ftplugin/perl.vim
34: c:/vim/vim70/indent/perl.vim
35: c:/vim/vim70/scripts.vim
36: c:/vim/vim70/syntax/conf.vim
37: c:/vim/vim70/ftplugin/conf.vim
38: c:/vim/vim70/autoload/netrw.vim
39: c:/vim/vim70/syntax/netrw.vim
40: c:/vim/vim70/syntax/html.vim
41: c:/vim/vim70/syntax/javascript.vim
42: c:/vim/vim70/syntax/vb.vim
43: c:/vim/vim70/syntax/css.vim
44: c:/vim/vimfiles/ftplugin/html.vim
45: c:/vim/vimfiles/ftplugin/htm.vim
46: c:/vim/vimfiles/ftplugin/html_jmd.vim
47: c:/vim/vim70/ftplugin/html.vim
48: c:/vim/vim70/indent/html.vim
49: c:/vim/vim70/ftplugin/javascript.vim
50: c:/vim/vim70/syntax/help.vim
51: c:/vim/vim70/ftplugin/help.vim

Anything there that could be causing problems?

Thanks,


Jack
   



Do you have a variable "g:filetype_pl" set?  If so, this overrides the
filetype default for perl.  See ":help filetype-overrule", and
filetype.vim.

 

First make sure your filetype is set right.  I think for perl you can 
type one of the following:

:set ft=perl
or
:set ft=pl

If that doesn't work for you take a look at this site: 
http://www.vim.org/htmldoc/syntax.html#syntax-loading

There you will see the order of operations perfomed when you type :syntax on
Here is the files used in :syntax loading etc: 
http://www.vim.org/htmldoc/syntax.html#:syn-files


Try manually doing the steps for a perl file, i.e.:
* Clear out any old syntax 
 by sourcing 
$VIMRUNTIME/syntax/nosyntax.vim
* Take a look at the following command and try running it-  :au Syntax 
perlsource $VIMRUNTIME/syntax/perl.vim


Hopefully that will set your syntax highlighting up properly.  If not 
I'm not sure what to do :)  If it does work, then you have a config file 
somewhere misbehaving, or a vim "variable" set incorrectly perhaps...

Good Luck,
Chisum


Re: :vimgrep on all buffers

2006-05-31 Thread Cory Echols

On 5/31/06, Bernhard Leiner <[EMAIL PROTECTED]> wrote:

Hi!

I'm looking for a good soultion to to search for a keyword in all open buffers.

Using the :bufdo command to search in all buffers basically does what
I want but the output isn't very useable. Using :vimgrep on multiple
_files_ with its output in the quickfix window is much better but
works only on files.

Sombody has an idea?


Like most vim commands, if you use '%' as the file name argument to a
vimgrep command, it will expand to the filename of the current buffer.
This means you can use:

:bufdo vimgrepadd /pattern/ %

The catch is that 'vimgrepadd' *adds* matches to the current match
list.  If there's already entries in it, they'll be added to instead
of replaced.  I couldn't find any command that would clear the current
quickfix list, so I suppose you'd have to search for an unmatchable
pattern to clear it.  Try 200 x's anchored at the beginning of a line
in the current buffer.  Another catch is that I couldn't get :vimgrep
to accept a '|' command separator, so you have to do them in two
steps.

:vimgrep /\v^x{200}/ %
:bufdo vimgrepadd /pattern/ %


Re: Syntax Highlighting: Vim 7, Debian

2006-05-31 Thread Chisum Lindauer

Gregory Margo wrote:


On Tue, May 30, 2006 at 02:44:17PM -0400, Chisum Lindauer wrote:
 

Hello all I've just worked on trying to get this to work a few hours 
with no luck, so I thought I'd consult the community.


In short, my syntax highlighting doesn't work.  Not in vim or vim 
-g/gvim.  I've tried the easy things like :snytax enable or :syntax on 
and manually loading a colorscheme but to no effect.

I recently did an apt-get upgrade which broke my X install.
Once I had fixed that and returned to the world of GUI's I found my 
syntax highlighting didn't work.  The color test shows all the colors 
properly however. (Select it from the syntax menu in gvim).
At first I thought it might be because of my terminal, but changing that 
using tset and/or setting my TERM environment variable to xterm-color 
helped not in the least.  It's not just a color problem anyhow, as bold 
and italics don't work on syntax either.  It's not a colorscheme bug 
either, as I've tried using several colorschemes and get the same 
results (though it will change the bgcolor an fgcolor in gvim).


I tried removing and reinstalling gvim as well, but the problem 
persists.  Needless to say, now that I'm used to syntax highlighting 
being without it feels like losing an arm.


The only error message I've ever seen regarding the syntax is when I 
opened up gvim and select on/off for This file under the syntax menu, it 
tells me that my colorscheme can not be found when parsing 
syntax/synload.vim.  This error doesn't happen except when I first load 
vim, and only if I don't change the colorscheme before hand.  This might 
be a clue for someone, but probably not.


Also if I log into our server ssh -X and use gvim over the network, 
syntax highlighting does work, of course, that doesn't say a damn thing 
either.  It just makes me think that it's probably a configuration file 
of some sort...


I hope someone has an idea, I sure as hell don't.
Thanks,
Chisum Lindauer
   



If you have both vim-6 and vim-7 installed, there may be a conflict,
especially if you try to share a ~/.vim directory.  I'm running under
Debian Stable, and have the default vim-6.3.82 installed, and have a
locally compiled vim-7.0.15 installed also (with binary name 'vim7').
Syntax highlighting works find under either.  However,
I've kept them seperated with different .vimrc files, and different
'runtimepath' variables.

Try this: in an xterm (version 4.3.0.dfsg.1-14sarge1) run
"/path/to/your/vim7 -u NONE".

Now type ":help" - you should see black-n-white help text.
Now type ":syntax on" - you should see the help with syntax highlighting.

If does not work, it could be the color settings of the xterm itself.

Since you mentioned breaking your X setup, could it be that you're
running a bleeding edge Debian Unstable (etch) system?

 


"
Please report problems you experience with Debian's vim packages to
Debian (reportbug is your friendly bug reporting program).  At the very
least, peruse the bug list to see if someone has reported a similar
problem.
"

Indeed :)  Once I identify the problem I'll be sure to report it :)

"Try purging[0] vim-common..."
Thanks for the information on purging, I had only removed everything.  However, 
after purging and reinstalling I had no luck reinstalling from apt-get after a 
purge.  Next I'm going to purge and try reinstalling from source. :)


""/path/to/your/vim7 -u NONE".

Now type ":help" - you should see black-n-white help text.
Now type ":syntax on" - you should see the help with syntax highlighting."

It worked!  The help syntax highlighting came on.  I checked my dpkg --list | 
grep vim and I only have version 7 installed.  I'm not sure how to check if I'm 
on etch or not... (I'm actually sort of a Debian newbie).  But my etc/issue 
file says:
Debian GNU/Linux testing/unstable \n \l
and uname -a says:
Linux chewbaca 2.4.26-1-386 #1 Tue Aug 24 13:31:19 JST 2004 i686 GNU/Linux

(yes.. still on the 2.4 kernel...)

But now, how do I make this syntax highlighting work on a regular file and why 
is it not working on regular files if it works with :help?

I'm open to suggestions :)  In the mean time I'm going to try reinstalling from 
source and purging my current install.

Thanks to all who replied!
Chisum Lindauer



:vimgrep on all buffers

2006-05-31 Thread Bernhard Leiner

Hi!

I'm looking for a good soultion to to search for a keyword in all open buffers.

Using the :bufdo command to search in all buffers basically does what
I want but the output isn't very useable. Using :vimgrep on multiple
_files_ with its output in the quickfix window is much better but
works only on files.

Sombody has an idea?

regards,
   bernhard


RE: Copying everything (not the complete line, only the matching pattern) which matches a pattern

2006-05-31 Thread Vishnu
Hi Shankar,

1. Get the pattern matching lines in a separate buffer
:g//t$

2. 
:%s/^.*\(\).*$/\1/


~VIshhu

-Original Message-
From: SHANKAR R-R66203 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 31, 2006 4:06 PM
To: 'Vishnu'
Cc: vim@vim.org
Subject: RE: Copying everything (not the complete line, only the
matching pattern) which matches a pattern

This will copy the entire line.
I do not want to copy the entire line, but just the pattern.

Regards,
Shankar



>-Original Message-
>From: Vishnu [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 31, 2006 3:53 PM
>To: SHANKAR R-R66203
>Cc: vim@vim.org
>Subject: RE: Copying everything which matches a pattern
>
>Hi Shankar,
>
>
>:g//t$
>
>t - copy to address $
>
>
>you can call function instead of t$
>
>~Vishnu
>
>
>-Original Message-
>From: SHANKAR R-R66203 [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 31, 2006 3:41 PM
>To: 'vim@vim.org'
>Subject: Copying everything which matches a pattern
>
>
>Hi Vimmers,
>
>   I want to copy everything that matches a search pattern.
>
>For example, if my search pattern is
>
>/\$.*s
>
>I want to copy all the patterns that matches this into a buffer.
>
>How can I do this ?
>
>Regards,
>Shankar



Re: Upgrading VIM on Ubuntu

2006-05-31 Thread Pádraig Brady
Adam Young wrote:
> Hello,
>  I would like to upgrade my version of gvim (6.3) to version 7. I am
> a Ubuntu newbie; does anyone have any advice on the easiest way to do
> this?

http://www.freshnet.it/wordpress/blog/2006/05/24/vim-7-for-ubuntu-dapper-e-breezy/


RE: Copying everything (not the complete line, only the matching pattern) which matches a pattern

2006-05-31 Thread SHANKAR R-R66203
This will copy the entire line.
I do not want to copy the entire line, but just the pattern.

Regards,
Shankar



>-Original Message-
>From: Vishnu [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 31, 2006 3:53 PM
>To: SHANKAR R-R66203
>Cc: vim@vim.org
>Subject: RE: Copying everything which matches a pattern
>
>Hi Shankar,
>
>
>:g//t$
>
>t - copy to address $
>
>
>you can call function instead of t$
>
>~Vishnu
>
>
>-Original Message-
>From: SHANKAR R-R66203 [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 31, 2006 3:41 PM
>To: 'vim@vim.org'
>Subject: Copying everything which matches a pattern
>
>
>Hi Vimmers,
>
>   I want to copy everything that matches a search pattern.
>
>For example, if my search pattern is
>
>/\$.*s
>
>I want to copy all the patterns that matches this into a buffer.
>
>How can I do this ?
>
>Regards,
>Shankar


RE: Copying everything which matches a pattern

2006-05-31 Thread Vishnu
Hi Shankar,


:g//t$

t - copy to address $


you can call function instead of t$

~Vishnu


-Original Message-
From: SHANKAR R-R66203 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 31, 2006 3:41 PM
To: 'vim@vim.org'
Subject: Copying everything which matches a pattern


Hi Vimmers,

   I want to copy everything that matches a search pattern.
   
For example, if my search pattern is

/\$.*s

I want to copy all the patterns that matches this into a buffer.

How can I do this ?

Regards,
Shankar



Copying everything which matches a pattern

2006-05-31 Thread SHANKAR R-R66203

Hi Vimmers,

   I want to copy everything that matches a search pattern.
   
For example, if my search pattern is

/\$.*s

I want to copy all the patterns that matches this into a buffer.

How can I do this ?

Regards,
Shankar



Re: regexp question

2006-05-31 Thread Kyku

Ling F. Zhang wrote:

I have this question working in vi, but I suppose it's
generally enought for all regexp.

How do I match across line? I would like to find the
end to a sentence by looking for \.$^[A-Z], but it
doesn't work. What is the correct way of match across
two different lines.
How about   \.\_s*[A-Z]   - this should match inner ends of sentences 
too? It also looks that \.\n[A-Z] works, too.

In the same spirity, How should I
replace by inserting a \r or \n, i.e.

This is sentence one. This is sentence two.
becomes
This is sentence one.
This is sentence two.
  
In substitution pattern press Ctr-V and then Enter. It should be 
replaced by something like ^M, i.e:


:%s/\.\s\+\([A-Z]\)/.^M\1/gc



Re: How to make CTRLmappings working under Linux

2006-05-31 Thread A.J.Mechelynck

Eric Leenman wrote:

Hi,

On my Windows XP machine I have two mappings like below, and they work.

 noremap   b
 inoremap  

 noremap  w
 inoremap  

Why doesn't these work on my Linux machine?
Is CTRL handled different under Linux then under Windows?

Regards,
Eric


[advertisement snipped]

Under Linux, many key combinations are preempted by the window manager, 
so that Vim never sees them. It may or may not depend on which window 
manager you use. Mine uses Ctrl-Fx to switch virtual desktops within the 
X display, so I have to use Shift-Fx in my owncoded mappings instead. 
Some Ctrl-letter combos are preempted too or maybe they aren't located 
at the same keyboard location: one which is very annoying is Ctrl-] (go 
to tag or helptag under cursor): for that one I have set up the 
following mapping:


   map

so I can still follow hotlinks in the help, though by hitting F9 instead 
of Ctrl-]. Double-clicking the mouse still works but I rarely use the 
mouse in Vim.


To see if Vim receives something for a particular key combo, hit it, in 
Insert mode and preceded by Ctrl-V (or by Ctrl-Q if you use Ctrl-V to 
paste on the same machine). The byte(s) (if any) that Vim receives from 
the keyboard will be inserted, or, for a special key in gvim, the <> key 
designation (such as  for Shift-F9). (For instance, when I hit on 
my Linux machine what used to give Ctrl-] on my Belgian keyboard under 
Windows, I get $, i.e., just as if Ctrl hadn't been depressed.) If Vim 
receives nothing (and 'showcmd' is set), ^V will remain displayed near 
the right end of the command line. Hit the spacebar to insert a space 
and return to "normal" Insert mode.



Best regards,
Tony.