Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

vim · Vim (Vi IMproved) text editor users list

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 82222 - 82251 of 137765   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#82222 From: "Nikolaos Patsopoulos" <npatsop@...>
Date: Mon Sep 3, 2007 6:28 am
Subject: Re: vim | replacement question
npatsop@...
Send Email Send Email
 
On 8/31/07, Tim Chase <vim@...> wrote:

Tim thanks for the reply. Sorry but was away for couple of days.


>
> > A couple of questions:
> > 1.

>
> was there a question here?

Yes, there was. I want a text that looks like this:

<DIV>text</DIV>
<DIV>text</DIV>
<DIV>text</DIV>
<DIV>text</DIV>
<DIV>text</DIV>

text....
....
<DIV>text</DIV>
<DIV>text</DIV>
<DIV>text</DIV>
<DIV>text</DIV>

text.....

to be turned into this:


<DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV>

text....
....
<DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV>

text.....

my working code:
:%s/\(<\/DIV>\).*\n.*\(<DIV>.*<\/DIV>\)/\1\2

results:

<DIV>text</DIV><DIV>text</DIV>
<DIV>text</DIV><DIV>text</DIV>
<DIV>text</DIV>

text....
....
<DIV>text</DIV><DIV>text</DIV>
<DIV>text</DIV><DIV>text</DIV>

text.....

and have to run it more than once. The problem is that this a script
actually and don't know how many times this particular code has to be
run eventually.

>
> > 2.
I believe I oversimplified this.
Here is a section of the text:

<SPONSORS>Kendle International</SPONSORS><DIV>Abbott</DIV>
                               <DIV>Barr Laboratories</DIV>
                               <DIV>Boehringer Ingelheim Pharmaceuticals</DIV>
                               <DIV>Bristol-Myers Squibb</DIV>
                               <DIV>Gilead Sciences</DIV>
                               <DIV>GlaxoSmithKline</DIV>
                               <DIV>Hoffmann-La Roche</DIV>
                               <DIV>Idenix Pharmaceuticals</DIV>
                               <DIV>Merck</DIV>
                               <DIV>Novartis</DIV>
                               <DIV>Pfizer</DIV>
                               <DIV>Ranbaxy Laboratories Ltd</DIV>
                               <DIV>Tibotec Pharmaceutical Limited</DIV>

I want to turn this to
<SPONSORS>Kendle International</SPONSORS><SPONSORS>Abbott</SPONSORS>
                               <SPONSORS>Barr Laboratories</SPONSORS>
                               <SPONSORS>Boehringer Ingelheim
Pharmaceuticals</SPONSORS>
                               <SPONSORS>Bristol-Myers Squibb</SPONSORS>
                               <SPONSORS>Gilead Sciences</SPONSORS>
                               <SPONSORS>GlaxoSmithKline</SPONSORS>
                               <SPONSORS>Hoffmann-La Roche</SPONSORS>
                               <SPONSORS>Idenix Pharmaceuticals</SPONSORS>
                               <SPONSORS>Merck</SPONSORS>
                               <SPONSORS>Novartis</SPONSORS>
                               <SPONSORS>Pfizer</SPONSORS>
                               <SPONSORS>Ranbaxy Laboratories Ltd</SPONSORS>
                               <SPONSORS>Tibotec Pharmaceutical
Limited</SPONSORS>

I cannot just turn all DIV to SPONSORS cause there are DIV tags that
need to be unchanged. My working code does one pass each time and the
one Tim suggested just erases the first DIV tags (my fault actually).

> > pattern1 pattern1 pattern1 pattern1 pattern1 pattern1
> >
> > working code:
> >
> > :%s/\(pattern1\)\(pattern2\)/\1\2
> >

>
> While yes, you can use a "while" loop, you may want to use a
> "sub-replace-special" secondary call to substitute, such as
>
>
:%s/^\(pattern1\)\s\+\(\%(pattern2\n\)\+\)/\=submatch(1).substitute(submatch(2),
> 'pattern2\n', ' '.submatch(1), 'g')
>
>
> -tim
>


Thanks,

Nikos

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82223 From: hermitte@...
Date: Mon Sep 3, 2007 9:23 am
Subject: Re: vim C++ tips
hermitte@...
Send Email Send Email
 
Hello,

Pavel Shevaev <pacha.shevaev@...> wrote:


> Folks, could you please suggest some links for C++ development with
> vim? Unfortunately after pretty much googling around I haven't found
> for C++ anything as comprehensive as, say, "vim for PHP programmers"
> by Adrei Zmievski(btw, almost everything mentioned in Andrei's slides
> is applicable to C++ as well, many thanks to him!)

There are two big suites of ftplugins for C&C++. I'm maintening one of them [1]
As far as I known, mine is the only one coming with functions able to analyse
C++ function signatures, determine the current scope, ...
However it is quite intrusive as it imposes by default (i.e. it can be
deactivated) the use of placeholder/markers, and many context-sensitive
abbreviations. Not everybody like it.


> I think I know some basics(using ctags with taglist, cscope, A plugin
> etc) but I guess there should be more ;) For example, I guess there
> should be some tip how to simplify maintaining implementation and
> declaration of a function/method.

:GOTOIMPL/MOVETOIMPL (with my suite ; there are still a few bugs)

> It would be just great if changing args in the implementation
> would update them automatically in the header as well.

This problem is a problem I wish to solve. However, I don't know how to solve
it. Not that I don't know how to fetch and recognize functions (I have already
implemeted a kind of VimL API for analysing C++). The problem is I don't know
what the end-vim-user (i.e. us) should type on its keyboard to mark the initial
function, make the changes, and them propagate the modifications to the
associated declaration (or definition).

Any idea is welcomed.

> And so on...

As John pointed out, there is a section dedicated to C++ vim tips on vim.wikia.

Regarding the other plugins I use for developping in C++, there is also:
- EnhancedCommentify (for toggling comments)
- a.vim
- cvsmenu

And also a few other plugins I'm maintening [2]
- SearchInRuntime (for h/v spliting the current window and opening a file, from
&path, identified by its name (wildcards accepted) => no need for any project
brwoser)
- local_vimrc (for having project settings ; a project is defined by a hierarchy
of directories)
- BuildToolsWrappers (for simplifiyng the merging of compiler plugins, and
filtering compilation outputs)
- Refactor (that I hope to release soon ; only /extract method/, /extract
expression/, and /extract type/ are supported for the moment)


[1] http://hermitte.free.fr/vim/ressources/lh-cpp.tar.gz (the lastest version of
the VimL API for C++ is a bit different from the one in te archive)
[2] http://hermitte.free.fr/vim/ressources/

HTH,
--
Luc Hermitte
http://hermitte.free.fr/vim/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82224 From: Lazy Fox <lazy.fox.wu@...>
Date: Mon Sep 3, 2007 9:23 am
Subject: Re: How can i comple gvim 7.1 on FC5?
lazy.fox.wu@...
Send Email Send Email
 
thanks a lot, i'll try it.

On Sep 2, 10:50 pm, Tony Mechelynck <antoine.mechely...@...>
wrote:
> Lazy Fox wrote:
> > thank u
> > Is there any way to check which packages of my FC5 is missed?
>
> As I said, get your config.log and find out what configure was looking for and
> didn't find.
>
> Then, use grep on the output of "rpm  -qa" to find if a given package is
> installed. For instance, for GTK2,
>
>         rpm -qa |grep gtk2
>
> will give you _all_ installed packages whose name includes "gtk2". If you
> haven't got gtk2-devel, that's already one missing package. Similarly for X11
> -- there the name may vary. There are a huge lot of packages with "x11" in
> their name. On SuSE 10.2, I think the relevant one is "xorg-x11-devel-7.2-19".
>
> Or else you could use
>
>         rpm -qa | grep devel | less
>
> and check that everything you need to use is listed there. In case of doubt,
> check what config was looking for.
>
> Best regards,
> Tony.
> --
> Evangelists do it with Him watching.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82225 From: Tony Mechelynck <antoine.mechelynck@...>
Date: Mon Sep 3, 2007 9:51 am
Subject: Re: vim | replacement question
antoine.mechelynck@...
Send Email Send Email
 
Nikolaos Patsopoulos wrote:
> On 8/31/07, Tim Chase <vim@...> wrote:
>
> Tim thanks for the reply. Sorry but was away for couple of days.
>
>
>>> A couple of questions:
>>> 1.
>
>> was there a question here?
>
> Yes, there was. I want a text that looks like this:
>
> <DIV>text</DIV>
> <DIV>text</DIV>
> <DIV>text</DIV>
> <DIV>text</DIV>
> <DIV>text</DIV>
>
> text....
> ....
> <DIV>text</DIV>
> <DIV>text</DIV>
> <DIV>text</DIV>
> <DIV>text</DIV>
>
> text.....
>
> to be turned into this:
>
>
> <DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV>
>
> text....
> ....
> <DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV>
>
> text.....
>
> my working code:
> :%s/\(<\/DIV>\).*\n.*\(<DIV>.*<\/DIV>\)/\1\2
>
> results:
>
> <DIV>text</DIV><DIV>text</DIV>
> <DIV>text</DIV><DIV>text</DIV>
> <DIV>text</DIV>
>
> text....
> ....
> <DIV>text</DIV><DIV>text</DIV>
> <DIV>text</DIV><DIV>text</DIV>
>
> text.....
>
> and have to run it more than once. The problem is that this a script
> actually and don't know how many times this particular code has to be
> run eventually.
>
>>> 2.
> I believe I oversimplified this.
> Here is a section of the text:
>
> <SPONSORS>Kendle International</SPONSORS><DIV>Abbott</DIV>
>                               <DIV>Barr Laboratories</DIV>
>                               <DIV>Boehringer Ingelheim Pharmaceuticals</DIV>
>                               <DIV>Bristol-Myers Squibb</DIV>
>                               <DIV>Gilead Sciences</DIV>
>                               <DIV>GlaxoSmithKline</DIV>
>                               <DIV>Hoffmann-La Roche</DIV>
>                               <DIV>Idenix Pharmaceuticals</DIV>
>                               <DIV>Merck</DIV>
>                               <DIV>Novartis</DIV>
>                               <DIV>Pfizer</DIV>
>                               <DIV>Ranbaxy Laboratories Ltd</DIV>
>                               <DIV>Tibotec Pharmaceutical Limited</DIV>
>
> I want to turn this to
> <SPONSORS>Kendle International</SPONSORS><SPONSORS>Abbott</SPONSORS>
>                               <SPONSORS>Barr Laboratories</SPONSORS>
>                               <SPONSORS>Boehringer Ingelheim
> Pharmaceuticals</SPONSORS>
>                               <SPONSORS>Bristol-Myers Squibb</SPONSORS>
>                               <SPONSORS>Gilead Sciences</SPONSORS>
>                               <SPONSORS>GlaxoSmithKline</SPONSORS>
>                               <SPONSORS>Hoffmann-La Roche</SPONSORS>
>                               <SPONSORS>Idenix Pharmaceuticals</SPONSORS>
>                               <SPONSORS>Merck</SPONSORS>
>                               <SPONSORS>Novartis</SPONSORS>
>                               <SPONSORS>Pfizer</SPONSORS>
>                               <SPONSORS>Ranbaxy Laboratories Ltd</SPONSORS>
>                               <SPONSORS>Tibotec Pharmaceutical
> Limited</SPONSORS>
>
> I cannot just turn all DIV to SPONSORS cause there are DIV tags that
> need to be unchanged. My working code does one pass each time and the
> one Tim suggested just erases the first DIV tags (my fault actually).
>
>>> pattern1 pattern1 pattern1 pattern1 pattern1 pattern1
>>>
>>> working code:
>>>
>>> :%s/\(pattern1\)\(pattern2\)/\1\2
>>>
>
>> While yes, you can use a "while" loop, you may want to use a
>> "sub-replace-special" secondary call to substitute, such as
>>
>>
:%s/^\(pattern1\)\s\+\(\%(pattern2\n\)\+\)/\=submatch(1).substitute(submatch(2),
>> 'pattern2\n', ' '.submatch(1), 'g')
>>
>>
>> -tim
>>
>
>
> Thanks,
>
> Nikos

	 :[range]s/from/to

replaces only once per line. Add /g at the end to replace as many times as
possible.

Maybe

	 :%s/\c<\/div>\zs\n\ze<div>//g

or even

	 :%s/>\zs\n\ze<//g

?


Note: The <div> element is a block element. When rendered, it will get
linebreaks around itself. Therefore, it feels "natural" to also break the
source lines around <div>...</div>. The corresponding inline element is <span>.


Best regards,
Tony.
--
If you don't get everything you want, think of
everything you didn't get and don't want.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82226 From: "Pavel Shevaev" <pacha.shevaev@...>
Date: Mon Sep 3, 2007 9:55 am
Subject: Re: vim C++ tips
pacha.shevaev@...
Send Email Send Email
 
> Any idea is welcomed.

How about marking some area in a header file with some tags which will
be rewritten with function declarations taken from implementation each
time the user types some special command?

Something like this in header file:

/*AUTO DECLARATIONS START*/
...
/*AUTO DECLARATIONS END*/

Say, once I type :imp2decl the current file's function declarations
copied to the header, simply rewriting all contents of these special
tags.

> [1] http://hermitte.free.fr/vim/ressources/lh-cpp.tar.gz (the lastest version
of
> the VimL API for C++ is a bit different from the one in te archive)
> [2] http://hermitte.free.fr/vim/ressources/

Thank you very much for such a detailed answer, I'm definitely going
to have a very close look at these resources.

--
Best regards, Pavel

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82227 From: "Nikolaos Patsopoulos" <npatsop@...>
Date: Mon Sep 3, 2007 9:57 am
Subject: Re: vim | replacement question
npatsop@...
Send Email Send Email
 
>
>         :[range]s/from/to
>
> replaces only once per line. Add /g at the end to replace as many times as
> possible.
>
> Maybe
>
>         :%s/\c<\/div>\zs\n\ze<div>//g

This seems to work in a dummy. Will try later in my source file and
let you know if there is any problem. Can you suggest any further
reading on th topic (especially \zs\ze)?
>
> or even
>
>         :%s/>\zs\n\ze<//g
>
> ?
>
>
> Note: The <div> element is a block element. When rendered, it will get
> linebreaks around itself. Therefore, it feels "natural" to also break the
> source lines around <div>...</div>. The corresponding inline element is
<span>.
>

Any suggestion for question 2?
>


Thanks,

Nikos

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82228 From: Tony Mechelynck <antoine.mechelynck@...>
Date: Mon Sep 3, 2007 10:28 am
Subject: Re: vim | replacement question
antoine.mechelynck@...
Send Email Send Email
 
Nikolaos Patsopoulos wrote:
>>         :[range]s/from/to
>>
>> replaces only once per line. Add /g at the end to replace as many times as
>> possible.
>>
>> Maybe
>>
>>         :%s/\c<\/div>\zs\n\ze<div>//g
>
> This seems to work in a dummy. Will try later in my source file and
> let you know if there is any problem. Can you suggest any further
> reading on th topic (especially \zs\ze)?

	 :help pattern.txt
	 :help pattern-overview
	 :help pattern-atoms

etc.

>> or even
>>
>>         :%s/>\zs\n\ze<//g
>>
>> ?
>>
>>
>> Note: The <div> element is a block element. When rendered, it will get
>> linebreaks around itself. Therefore, it feels "natural" to also break the
>> source lines around <div>...</div>. The corresponding inline element is
<span>.
>>
>
> Any suggestion for question 2?

er, sorry, I wasn't following. What were we talking about?

>
>
> Thanks,
>
> Nikos

Best regards,
Tony.
--
Too much of a good thing is WONDERFUL.
		 -- Mae West

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82229 From: "Richard Hartmann" <richih.mailinglist@...>
Date: Mon Sep 3, 2007 10:45 am
Subject: Set a variable for a single buffer via autocmd
richih.mailinglist@...
Send Email Send Email
 
From what I understand,

autocmd FileType perl <buffer> iskeyword+=:

should add the colon to my keyword list for the one
buffer that contains a perl file, but this is not the case.


Any ideas?
Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82230 From: Tony Mechelynck <antoine.mechelynck@...>
Date: Mon Sep 3, 2007 10:59 am
Subject: Re: Set a variable for a single buffer via autocmd
antoine.mechelynck@...
Send Email Send Email
 
Richard Hartmann wrote:
>>From what I understand,
>
> autocmd FileType perl <buffer> iskeyword+=:
>
> should add the colon to my keyword list for the one
> buffer that contains a perl file, but this is not the case.
>
>
> Any ideas?
> Richard

	 :autocmd FileType perl setlocal iskeyword+=:

In general:

replace ":set" by ":setlocal"
replace ":let name = expression" by ":let b:name = expression"
replace ":map" by ":map <buffer>"

etc.


Best regards,
Tony.
--
Chipmunks roasting on an open fire
Jack Frost ripping up your nose
Yuletide carolers being thrown in the fire
And folks dressed up like buffaloes
Everybody knows a turkey slaughtered in the snow
Helps to make the season right
Tiny tots with their eyes all gouged out
Will find it hard to see tonight
They know that Santa's on his way
He's loaded lots of guns and bullets on his sleigh
And every mother's child is sure to spy
To see if reindeer really scream when they die
And so I'm offering this simple phrase
To kids from one to ninety two
Although it's been said many times, many ways
Merry Christmas, Merry Christmas, Merry Christmas, Fuck you!!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82231 From: "Nikolaos Patsopoulos" <npatsop@...>
Date: Mon Sep 3, 2007 11:02 am
Subject: Re: vim | replacement question
npatsop@...
Send Email Send Email
 
:)


>
> er, sorry, I wasn't following. What were we talking about?
>
> >

> > 2.
I believe I oversimplified this.
Here is a section of the text:

<SPONSORS>Kendle International</SPONSORS><DIV>Abbott</DIV>
                              <DIV>Barr Laboratories</DIV>
                              <DIV>Boehringer Ingelheim Pharmaceuticals</DIV>
                              <DIV>Bristol-Myers Squibb</DIV>
                              <DIV>Gilead Sciences</DIV>
                              <DIV>GlaxoSmithKline</DIV>
                              <DIV>Hoffmann-La Roche</DIV>
                              <DIV>Idenix Pharmaceuticals</DIV>
                              <DIV>Merck</DIV>
                              <DIV>Novartis</DIV>
                              <DIV>Pfizer</DIV>
                              <DIV>Ranbaxy Laboratories Ltd</DIV>
                              <DIV>Tibotec Pharmaceutical Limited</DIV>

I want to turn this to
<SPONSORS>Kendle International</SPONSORS><SPONSORS>Abbott</SPONSORS>
                              <SPONSORS>Barr Laboratories</SPONSORS>
                              <SPONSORS>Boehringer Ingelheim
Pharmaceuticals</SPONSORS>
                              <SPONSORS>Bristol-Myers Squibb</SPONSORS>
                              <SPONSORS>Gilead Sciences</SPONSORS>
                              <SPONSORS>GlaxoSmithKline</SPONSORS>
                              <SPONSORS>Hoffmann-La Roche</SPONSORS>
                              <SPONSORS>Idenix Pharmaceuticals</SPONSORS>
                              <SPONSORS>Merck</SPONSORS>
                              <SPONSORS>Novartis</SPONSORS>
                              <SPONSORS>Pfizer</SPONSORS>
                              <SPONSORS>Ranbaxy Laboratories Ltd</SPONSORS>
                              <SPONSORS>Tibotec Pharmaceutical Limited</SPONSORS>

I cannot just turn all DIV to SPONSORS cause there are DIV tags that
need to be unchanged. My working code does one pass each time and the
one Tim suggested just erases the first DIV tags (my fault actually).

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82232 From: Tony Mechelynck <antoine.mechelynck@...>
Date: Mon Sep 3, 2007 11:17 am
Subject: Re: vim | replacement question
antoine.mechelynck@...
Send Email Send Email
 
Nikolaos Patsopoulos wrote:
> :)
>
>
>> er, sorry, I wasn't following. What were we talking about?
>>
>
>>> 2.
> I believe I oversimplified this.
> Here is a section of the text:
>
> <SPONSORS>Kendle International</SPONSORS><DIV>Abbott</DIV>
>                              <DIV>Barr Laboratories</DIV>
>                              <DIV>Boehringer Ingelheim Pharmaceuticals</DIV>
>                              <DIV>Bristol-Myers Squibb</DIV>
>                              <DIV>Gilead Sciences</DIV>
>                              <DIV>GlaxoSmithKline</DIV>
>                              <DIV>Hoffmann-La Roche</DIV>
>                              <DIV>Idenix Pharmaceuticals</DIV>
>                              <DIV>Merck</DIV>
>                              <DIV>Novartis</DIV>
>                              <DIV>Pfizer</DIV>
>                              <DIV>Ranbaxy Laboratories Ltd</DIV>
>                              <DIV>Tibotec Pharmaceutical Limited</DIV>
>
> I want to turn this to
> <SPONSORS>Kendle International</SPONSORS><SPONSORS>Abbott</SPONSORS>
>                              <SPONSORS>Barr Laboratories</SPONSORS>
>                              <SPONSORS>Boehringer Ingelheim
> Pharmaceuticals</SPONSORS>
>                              <SPONSORS>Bristol-Myers Squibb</SPONSORS>
>                              <SPONSORS>Gilead Sciences</SPONSORS>
>                              <SPONSORS>GlaxoSmithKline</SPONSORS>
>                              <SPONSORS>Hoffmann-La Roche</SPONSORS>
>                              <SPONSORS>Idenix Pharmaceuticals</SPONSORS>
>                              <SPONSORS>Merck</SPONSORS>
>                              <SPONSORS>Novartis</SPONSORS>
>                              <SPONSORS>Pfizer</SPONSORS>
>                              <SPONSORS>Ranbaxy Laboratories Ltd</SPONSORS>
>                              <SPONSORS>Tibotec Pharmaceutical
Limited</SPONSORS>
>
> I cannot just turn all DIV to SPONSORS cause there are DIV tags that
> need to be unchanged. My working code does one pass each time and the
> one Tim suggested just erases the first DIV tags (my fault actually).

One way to do it would be

	 :%s/\<DIV\>/SPONSORS/gc

but it would require you to approve manually every change.

Or else, highlight (in linewise-visual) ranges where all DIV must be changed
to SPONSORS, then

	 :'<,'>s/\<DIV\>/SPONSORS/g

Notes:
- the '<,'> range is inserted by Vim when you hit : in Visual mode, it means
"from the first to the last line of the Visual selection".
- \< and \> mark word boundaries in a pattern.



Best regards,
Tony.
--
The net of law is spread so wide,
No sinner from its sweep may hide.
Its meshes are so fine and strong,
They take in every child of wrong.
O wondrous web of mystery!
Big fish alone escape from thee!
		 -- James Jeffrey Roche

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82233 From: "Richard Hartmann" <richih.mailinglist@...>
Date: Mon Sep 3, 2007 11:14 am
Subject: Re: Set a variable for a single buffer via autocmd
richih.mailinglist@...
Send Email Send Email
 
On 03/09/07, Tony Mechelynck <antoine.mechelynck@...> wrote:


> autocmd FileType perl setlocal iskeyword+=:

I thought I had tried that before. Must have missed it closely :p


Thanks!
Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82234 From: "Richard Hartmann" <richih.mailinglist@...>
Date: Mon Sep 3, 2007 11:26 am
Subject: Warn on modelines?
richih.mailinglist@...
Send Email Send Email
 
Hi,

can I enable a warning/notification when modelines are
embedded into a file? I want to use them, but I want
to guard against modelines others might have left
without me noticing it :)


Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82235 From: "Yongwei Wu" <wuyongwei@...>
Date: Mon Sep 3, 2007 12:14 pm
Subject: Re: Warn on modelines?
wuyongwei@...
Send Email Send Email
 
On 03/09/07, Richard Hartmann <richih.mailinglist@...> wrote:
>
> Hi,
>
> can I enable a warning/notification when modelines are
> embedded into a file? I want to use them, but I want
> to guard against modelines others might have left
> without me noticing it :)

I am quite surprised that you want to "guard against" the modeline.  I
mean, modeline-set options are local, and won't affect other files, so
I cannot imagine any real-world case where one wants to avoid its
effect.

This said, it is always possible to search in the file for the string
"\<vim:" to tell whether a modeline exists and do something as you
want.  Do it in a BufReadPost autocommand.

Best regards,

Yongwei

--
Wu Yongwei
URL: http://wyw.dcweb.cn/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82236 From: "Richard Hartmann" <richih.mailinglist@...>
Date: Mon Sep 3, 2007 12:57 pm
Subject: Re: Warn on modelines?
richih.mailinglist@...
Send Email Send Email
 
On 03/09/07, Yongwei Wu <wuyongwei@...> wrote:

> I am quite surprised that you want to "guard against" the modeline.  I
> mean, modeline-set options are local, and won't affect other files, so
> I cannot imagine any real-world case where one wants to avoid its
> effect.

Well, I have quite some bells and whistles in my .vimrc and I don't
want to find out $stuff went away because someone overrode it in a
way that he likes, but I do not.


> This said, it is always possible to search in the file for the string
> "\<vim:" to tell whether a modeline exists and do something as you
> want.  Do it in a BufReadPost autocommand.

Yah, I thought about that as well, but it is a bit ugly (and slow) :/


Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82237 From: Lazy Fox <lazy.fox.wu@...>
Date: Mon Sep 3, 2007 1:00 pm
Subject: Did someone use "gdbvim" or "idevim"
lazy.fox.wu@...
Send Email Send Email
 
I don't know how to use them, can you describe them for me?

how to install and how to use with vim7?

thanks!!!


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82238 From: Tim Chase <vim@...>
Date: Mon Sep 3, 2007 1:38 pm
Subject: Re: vim | replacement question
vim@...
Send Email Send Email
 
> I believe I oversimplified this.
> Here is a section of the text:
>
> <SPONSORS>Kendle International</SPONSORS><DIV>Abbott</DIV>
>                              <DIV>Barr Laboratories</DIV>
>                              <DIV>Boehringer Ingelheim Pharmaceuticals</DIV>
>                              <DIV>Bristol-Myers Squibb</DIV>
>                              <DIV>Gilead Sciences</DIV>
>                              <DIV>GlaxoSmithKline</DIV>
>                              <DIV>Hoffmann-La Roche</DIV>
>                              <DIV>Idenix Pharmaceuticals</DIV>
>                              <DIV>Merck</DIV>
>                              <DIV>Novartis</DIV>
>                              <DIV>Pfizer</DIV>
>                              <DIV>Ranbaxy Laboratories Ltd</DIV>
>                              <DIV>Tibotec Pharmaceutical Limited</DIV>
>
> I want to turn this to
> <SPONSORS>Kendle International</SPONSORS><SPONSORS>Abbott</SPONSORS>
>                              <SPONSORS>Barr Laboratories</SPONSORS>
>                              <SPONSORS>Boehringer Ingelheim
> Pharmaceuticals</SPONSORS>
>                              <SPONSORS>Bristol-Myers Squibb</SPONSORS>
>                              <SPONSORS>Gilead Sciences</SPONSORS>
>                              <SPONSORS>GlaxoSmithKline</SPONSORS>
>                              <SPONSORS>Hoffmann-La Roche</SPONSORS>
>                              <SPONSORS>Idenix Pharmaceuticals</SPONSORS>
>                              <SPONSORS>Merck</SPONSORS>
>                              <SPONSORS>Novartis</SPONSORS>
>                              <SPONSORS>Pfizer</SPONSORS>
>                              <SPONSORS>Ranbaxy Laboratories Ltd</SPONSORS>
>                              <SPONSORS>Tibotec Pharmaceutical
Limited</SPONSORS>
>
> I cannot just turn all DIV to SPONSORS cause there are DIV tags that
> need to be unchanged. My working code does one pass each time and the
> one Tim suggested just erases the first DIV tags (my fault actually).


Ah...definitely some miscommunication there.  Assuming that your
block of <DIV> tags is terminated by a blank line, you can use
something like

   :g/<SPONSORS>/.,'}s/<\/\=\zsDIV\ze>/SPONSORS/g

which will

g/            on every line matching
<SPONSORS>    a "<SPONSORS>" tag
/             do the following action
.             from this matching line (an optional default)
,             through
'}            the end of the paragraph (blank line)
s/            change all
<             opening tag
\/\=          followed by an optional "/"
\zs           note this as the beginning of the place to replace
DIV           followed by "DIV"
\ze           note this as the end of the place to replace
>             the end of the DIV tag
/             and replace that tag-name with
SPONSORS      the literal text "SPONSORS"
/g            for all instances on the line


It doesn't do any line-joining, but this time your example didn't
have any joined lines...If also needed, you could do something like

   g/<SPONSORS>/.,'}-j|s/<\/\=\zsDIV\ze>/SPONSORS/g:

which joins those lines first and then does the replacement on
the resulting line.

-tim






--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82239 From: "David Fishburn" <dfishburn.vim@...>
Date: Mon Sep 3, 2007 1:45 pm
Subject: ANN: dbext.vim 5.0 released
dfishburn.vim@...
Send Email Send Email
 
What is it?
-----------
dbext.vim : Provides database access to most databases.
http://www.vim.org/scripts/script.php?script_id=356

This plugin contains functions/mappings/commands to enable Vim to access several databases. Currently Mysql, PostgreSQL, Ingres, Oracle, Sybase Adaptive Server Anywhere, Sybase Adaptive Server Enterprise, Microsoft SQL Server, DB2 and Interbase are supported.  It abstracts database access, so the same Vim commands will produce the same output regardless of the database you use. 

What is new in 5.0?

New Features
------------
- Added Perl's DBI and DBI::ODBC support.  This opens additional database support without having to adjust the scripts.  You must have a Perl enabled Vim (:echo has('perl')).  Using the DBI layer offers some advantages over using the native binary tools:
       - Transaction support which allows you to maintain a transaction during your editing session and either commit or rollback and changes. This is not possible without using the DBI layer.
       - Speed improvements, since the database connection is maintained, the there is less overhead per command.
       - Huge thanks to Jean-Christophe Clavier and Albie Janse van Rensburg for their beta testing and suggestions.

- New commands are available to select only a few rows instead of an entire result set.  In most databases this is referred to as TOP X.  DBExecSQLTopX, DBExecVisualSQLTopX, DBExecSQLUnderCursorTopX have been added plus associated mappings (Albie Janse van Rensburg).

- Made Cygwin detection a bit easier using the shellslash option (Steve Gibson)

- dbext now supports Vim 7's autoload feature.


Bug Fixes
------------
- SQL Server support had issues with the queries when running DBCompleteTable, DBCompleteProcedure, DBCompleteView which also affected the sqlcomplete.vim plugin included with Vim7 (Albie Janse van Rensburg).

- Oracle reported "rows will be truncated", added "set linesize 10000" to the Oracle headers (Stuart Brock)

- When prompting for connection parameters if you choose a profile of "0"  which is no profile, you had to re-run the wizard to prompt for the rest of the parameters, now the wizard continues as expected.


After installing the plugin you can use:

:h dbext.txt
:h dbext-tutorial.txt


David Fishburn






--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


#82240 From: Tony Mechelynck <antoine.mechelynck@...>
Date: Mon Sep 3, 2007 1:41 pm
Subject: Re: vim 7.0: vimrc is ignored??
antoine.mechelynck@...
Send Email Send Email
 
janpla wrote:
>
> Oops - I hadn't subscribed to the mailing list; resending.
>
> I have just installed a new machine (Intel 64 bit, Redhat AS 5) - the vim
> version seems to be 7.0. I usually set some options in /etc/vimrc, but on
> this machine they seem to have no effect at all. I have checked with strace
> that vim actually looks for /etc/vimrc - which it does; it even reads the
> file. This is my vimrc (I don't have any local .vimrc):
>
> scriptencoding utf-8
> syntax off
> set compatible
> set bs=2
> set ai
> set history=50
> set nomodeline
> set nobackup
> set nohlsearch
> set noincsearch
> set t_ti= t_te=
>
> This configuration works on all my other Linuxes - so what's wrong here?
> Some new option in vim 7?

/etc/vimrc is a nonstandard default for the "system" vimrc on some
distributions.

The normal (and recommended) location is $HOME/.vimrc

Near the middle of the output of

	 :version

Vim will tell you where it looks for files. At the top of the same listing,
it'll also tell you its version, which patches (if any) were included, etc.,
so you'll know for certain whether you're using Vim 7.0 or something else.

Some of the options you set require optional compile-time feature. Are you by
any chance  using a "tiny" version (where all optional features are omitted)?
":version" will also tell you that.

BTW, the current version is (at the time of this writing) 7.1.094. See at
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm how I compile it on
Linux.


Best regards,
Tony.
--
A [golf] ball sliced or hooked into the rough shall be lifted and
placed in the fairway at a point equal to the distance it carried or
rolled into the rough.  Such veering right or left frequently results
from friction between the face of the club and the cover of the ball
and the player should not be penalized for the erratic behavior of the
ball resulting from such uncontrollable physical
phenomena.
		 -- Donald A. Metz

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82241 From: janpla <jandersen@...>
Date: Mon Sep 3, 2007 1:24 pm
Subject: vim 7.0: vimrc is ignored??
jandersen@...
Send Email Send Email
 
Oops - I hadn't subscribed to the mailing list; resending.

I have just installed a new machine (Intel 64 bit, Redhat AS 5) - the vim
version seems to be 7.0. I usually set some options in /etc/vimrc, but on
this machine they seem to have no effect at all. I have checked with strace
that vim actually looks for /etc/vimrc - which it does; it even reads the
file. This is my vimrc (I don't have any local .vimrc):

scriptencoding utf-8
syntax off
set compatible
set bs=2
set ai
set history=50
set nomodeline
set nobackup
set nohlsearch
set noincsearch
set t_ti= t_te=

This configuration works on all my other Linuxes - so what's wrong here?
Some new option in vim 7?
--
View this message in context:
http://www.nabble.com/vim-7.0%3A-vimrc-is-ignored---tf4372115.html#a12461510
Sent from the Vim - General mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82242 From: "A.Politz" <politza@...>
Date: Mon Sep 3, 2007 2:00 pm
Subject: Re: ANN: dbext.vim 5.0 released
politza@...
Send Email Send Email
 
David Fishburn wrote:

>       - Transaction support which allows you to maintain a transaction
>during your editing session and either commit or rollback and changes. This
>is not possible without using the DBI layer.
>
>
>
That's nice !

-ap

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82243 From: "A.Politz" <politza@...>
Date: Mon Sep 3, 2007 1:49 pm
Subject: Re: vim 7.0: vimrc is ignored??
politza@...
Send Email Send Email
 
janpla wrote:

>Oops - I hadn't subscribed to the mailing list; resending.
>
>I have just installed a new machine (Intel 64 bit, Redhat AS 5) - the vim
>version seems to be 7.0. I usually set some options in /etc/vimrc, but on
>this machine they seem to have no effect at all. I have checked with strace
>that vim actually looks for /etc/vimrc - which it does; it even reads the
>file. This is my vimrc (I don't have any local .vimrc):
>
>scriptencoding utf-8
>syntax off
>set compatible
>set bs=2
>set ai
>set history=50
>set nomodeline
>set nobackup
>set nohlsearch
>set noincsearch
>set t_ti= t_te=
>
>This configuration works on all my other Linuxes - so what's wrong here?
>Some new option in vim 7?
>
>
Maybe you want to try this :

  vim -V5vim.log -c ':e vim.log'

And examine what files actually get sourced and when.

-ap

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82244 From: "A.Politz" <politza@...>
Date: Mon Sep 3, 2007 1:43 pm
Subject: Re: vim | replacement question
politza@...
Send Email Send Email
 
npatsop@... wrote:

>Hi,
>
>A couple of questions:
>
>1.
>
>I have a text that has a lot of <DIV></DIV> tags spread across many
>lines and I want to put all tags of the same section in the same line:
>
><DIV>text</DIV>
><DIV>text</DIV>
><DIV>text</DIV>
><DIV>text</DIV>
><DIV>text</DIV>
>
>text....
>....
><DIV>text</DIV>
><DIV>text</DIV>
><DIV>text</DIV>
><DIV>text</DIV>
>
>text.....
>
>This should be like this:
>
><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</
>DIV>
>
>text....
>....
><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV><DIV>text</DIV>
>
>text.....
>
>working code:
>
>:%s/\(<\/DIV>\).*\n.*\(<DIV>.*<\/DIV>\)/\1\2
>
>2.
>
>I want to replace all consecutive of a pattern:
>
>pattern1 pattern2
>pattern2
>pattern2
>pattern2... (n times)
>
>to:
>
>pattern1 pattern1 pattern1 pattern1 pattern1 pattern1
>
>working code:
>
>:%s/\(pattern1\)\(pattern2\)/\1\2
>
>Can I use a while loop?
>
>:while (pattern2 not found)
>: code
>
>Thanks in advance,
>
>
>Nikos
>
>
>>
>
>
Here is some more working code for you :

g/DIV/if getline(line('.')-1) =~ '<SPONSORS>' | -j | endif
/<\/SPONSORS>/;/\(\_s*<DIV>[^<]*<\/DIV>\)*\zs/-s/\s*\n\s*//
/<\/SPONSORS>/;/\(\_s*<DIV>[^<]*<\/DIV>\)*\zs/s/DIV/SPONSORS/g
/<\/SPONSORS>/;/\(\_s*<DIV>[^<]*<\/DIV>\)*\zs/j | s/DIV/SPONSORS/g

/A/;/B/C
First search for A then for B and then exec C on the resulting lines.

-ap


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82245 From: hermitte@...
Date: Mon Sep 3, 2007 2:49 pm
Subject: Re: Text object selection for function parameters
hermitte@...
Send Email Send Email
 
Hello,

"A.Politz" <politza@...> wrote:

[snip script]

Your use of searpair() reminded of the second argument I had completly missed.
Applying the same kind of technique than the one I used in my bracketing system,
here is the lastest version of the parameters selection mappings.

It's not yet perfect, but quite functional.

Thanks a lot!

---------- >% ------------
" Notes:
" * "i," can't be used to select several parameters with several uses of
" "i," ; use "a," instead (-> va,a,a,). This is because of single
" letter parameters.
" However, "v2i," works perfectly.
" * Vim7+ only
" * The following should be resistant to &magic, and other mappings
onoremap <silent> i, :<c-u>call <sid>SelectParam(1,0)<cr>
xnoremap <silent> i, :<c-u>call <sid>SelectParam(1,1)<cr><esc>gv
onoremap <silent> a, :<c-u>call <sid>SelectParam(0,0)<cr>
xnoremap <silent> a, :<c-u>call <sid>SelectParam(0,1)<cr><esc>gv

function! s:SelectParam(inner, visual)
   let pos = getpos('.')
   if a:visual ==1 && s:CurChar("'>") =~ '[(,]'
     normal! gvl
   else
     let b = searchpair('\V(\zs','\V,\zs','\V)','bcW','s:Skip()')
     if 0 == b
       throw "Not on a parameter"
     endif
     normal! v
   endif
   let cnt = v:count <= 0 ? 1 : v:count

   while cnt > 0
     let cnt -= 1
     let e = searchpair('\V(', '\V,','\V)', 'W','s:Skip()')
     if 0 == e
       exe "normal! \<esc>"
       call setpos('.', pos)
       throw "Not on a parameter2"
     endif
     if cnt > 0
       normal! l
     endif
   endwhile
   if a:inner == 1
     normal! h
   endif
endfunction

function! s:CurChar(char)
   let c = getline(a:char)[col(a:char)-1]
   return c
endfunction

func! s:Skip()
   return synIDattr(synID(line('.'), col('.'), 0),'name') =~?
	 \ 'string\|comment\|character\|doxygen'
endfun
------------- >% ----------------

I'll add it into my C&C++ suite, and I guess I'll upload it soon as an
independant plugin on vim.org.

--
Luc Hermitte

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82246 From: janpla <jandersen@...>
Date: Mon Sep 3, 2007 3:14 pm
Subject: Re: vim 7.0: vimrc is ignored??
jandersen@...
Send Email Send Email
 
Hi Tony,

Well, :version tells me that the system vimrc is /etc/vimrc - trying "vim
-V5vim.log -c ':e vim.log'" confirms that this is the file that gets
sourced:

sourcing "/etc/vimrc"
line 2: sourcing "/usr/share/vim/vim70/syntax/nosyntax.vim"
finished sourcing /usr/share/vim/vim70/syntax/nosyntax.vim
continuing in /etc/vimrc
finished sourcing /etc/vimrc
could not source "$HOME/.vimrc"
could not source "$HOME/.exrc"

- this looks like it actually reads and understands the "syntax off" stmt,
but then just carries on and ignores the rest.

/jan




/etc/vimrc is a nonstandard default for the "system" vimrc on some
distributions.

The normal (and recommended) location is $HOME/.vimrc

Near the middle of the output of

	 :version

Vim will tell you where it looks for files. At the top of the same listing,
it'll also tell you its version, which patches (if any) were included, etc.,
so you'll know for certain whether you're using Vim 7.0 or something else.

Some of the options you set require optional compile-time feature. Are you
by
any chance  using a "tiny" version (where all optional features are
omitted)?
":version" will also tell you that.

BTW, the current version is (at the time of this writing) 7.1.094. See at
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm how I compile it
on
Linux.


--
View this message in context:
http://www.nabble.com/vim-7.0%3A-vimrc-is-ignored---tf4372115.html#a12463318
Sent from the Vim - General mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82247 From: "Nikolaos Patsopoulos" <npatsop@...>
Date: Mon Sep 3, 2007 3:14 pm
Subject: Re: vim | replacement question
npatsop@...
Send Email Send Email
 
Thank you all I've got it working now!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82248 From: Tony Mechelynck <antoine.mechelynck@...>
Date: Mon Sep 3, 2007 3:22 pm
Subject: Re: vim 7.0: vimrc is ignored??
antoine.mechelynck@...
Send Email Send Email
 
janpla wrote:
>
> Hi Tony,
>
> Well, :version tells me that the system vimrc is /etc/vimrc - trying "vim
> -V5vim.log -c ':e vim.log'" confirms that this is the file that gets
> sourced:
>
> sourcing "/etc/vimrc"
> line 2: sourcing "/usr/share/vim/vim70/syntax/nosyntax.vim"
> finished sourcing /usr/share/vim/vim70/syntax/nosyntax.vim
> continuing in /etc/vimrc
> finished sourcing /etc/vimrc
> could not source "$HOME/.vimrc"
> could not source "$HOME/.exrc"
>
> - this looks like it actually reads and understands the "syntax off" stmt,
> but then just carries on and ignores the rest.
>
> /jan

Well, what else does ":version" tell you? 7.0 or something else? Until which
patch? Tiny, small, normal, big or huge? +extra_search or -extra_search? (this
is the feature required for 'hlsearch') Etc.

See also ":help debug-mode" about line-by-line debugging of Vim scripts.


Best regards,
Tony.
--
Committee, n.:
	 A group of men who individually can do nothing but as a group
decide that nothing can be done.
		 -- Fred Allen

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82249 From: Tim Chase <vim@...>
Date: Mon Sep 3, 2007 1:25 pm
Subject: Re: Warn on modelines?
vim@...
Send Email Send Email
 
> Well, I have quite some bells and whistles in my .vimrc and I don't
> want to find out $stuff went away because someone overrode it in a
> way that he likes, but I do not.

That's precisely why I tend to set my preferred options in my
vimrc and then disable modelines.  However, there are occasional
times that I would like to be able to toggle things on a
per-file-type basis, such as sw/ts/et options when coding in
Python (I'm a "tabs" kinda guy).

>> This said, it is always possible to search in the file for the string
>> "\<vim:" to tell whether a modeline exists and do something as you
>> want.  Do it in a BufReadPost autocommand.
>
> Yah, I thought about that as well, but it is a bit ugly (and slow) :/


It shouldn't be any slower than normal modeline detection, as
modeline detection does the same thing, checking the first and
last &modelines lines to determine if it has the magic regexp.
One could do something like this untested

  :let i=0
  :let warn=0
  :while i<&modelines | if getline(i+1)=~'vim:' ||
getline(line('$')-i) =~ 'vim:' | let warn=1 | break | endif | let
i+=1 | endwhile
  :if warn | let &modeline = (confirm('Uses modelines.
Continue?', "&Yes\n&No", 1) == 1)


It might require some tightening up of the regexp to handle all
the various methods that vim allows, but the basic gist should
still hold.  It would also require putting this code in the
"right" place, which, IIUC, is the BufReadPost autocmd that you'd
want to use.

-tim






--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82250 From: "Andersen, Jan" <jandersen@...>
Date: Mon Sep 3, 2007 3:38 pm
Subject: RE: vim 7.0: vimrc is ignored??
jandersen@...
Send Email Send Email
 
Hi Tony,

It is certainly Huge and +extra_search - I'll have a closer look at the debug
feature you mentioned. I didn't want to dump the entire thing on the list just
like that, but this is what :version says:

:version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 28 2006 23:02:04)
Included patches: 1, 3-4, 7-9, 11, 13-17, 19-26, 29-31, 34-44, 47, 50-56, 58-64,
66-73, 75, 77-92, 94-107, 109
Modified by <bugzilla@...>
Compiled by <bugzilla@...>
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra
+extra_search +farsi +file_in_path +find_in_path +folding -footer +fork()
+gettext -hangul_input +iconv +insert_expand +jumplist
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec
+mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang
-mzscheme -netbeans_intg -osfiletype +path_extra
+perl +postscript +printer +profile +python +quickfix +reltime +rightleft -ruby
+scrollbind +signs +smartindent -sniff +statusline
-sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo
+termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11
-xfontset -xim -xsmp -xterm_clipboard -xterm_save
    system vimrc file: "/etc/vimrc"
      user vimrc file: "$HOME/.vimrc"
       user exrc file: "$HOME/.exrc"
   fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
-m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2   
-D_REENTRANT -D_GNU_SOURCE  -Wdeclaration-after-statement -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm 
-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE 
-I/usr/include/python2.4 -pthread
Linking: gcc   -Wl,-E
-Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE  
-L/usr/local/lib -o vim       -ltermcap  -lselinux  -lacl -lgpm   -Wl,-E
-Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE 
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a
-L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -lperl -lresolv -lutil
-lc -L/usr/lib64/python2.4/config -lpython2.4 -lutil -lm -Xlinker
-export-dynamic

/jan

-----Original Message-----
From: vim_use@googlegroups.com on behalf of Tony Mechelynck
Sent: Mon 03-Sep-07 16:22
To: vim_use@googlegroups.com
Subject: Re: vim 7.0: vimrc is ignored??


janpla wrote:
>
> Hi Tony,
>
> Well, :version tells me that the system vimrc is /etc/vimrc - trying "vim
> -V5vim.log -c ':e vim.log'" confirms that this is the file that gets
> sourced:
>
> sourcing "/etc/vimrc"
> line 2: sourcing "/usr/share/vim/vim70/syntax/nosyntax.vim"
> finished sourcing /usr/share/vim/vim70/syntax/nosyntax.vim
> continuing in /etc/vimrc
> finished sourcing /etc/vimrc
> could not source "$HOME/.vimrc"
> could not source "$HOME/.exrc"
>
> - this looks like it actually reads and understands the "syntax off" stmt,
> but then just carries on and ignores the rest.
>
> /jan

Well, what else does ":version" tell you? 7.0 or something else? Until which
patch? Tiny, small, normal, big or huge? +extra_search or -extra_search? (this
is the feature required for 'hlsearch') Etc.

See also ":help debug-mode" about line-by-line debugging of Vim scripts.


Best regards,
Tony.
--
Committee, n.:
	 A group of men who individually can do nothing but as a group
decide that nothing can be done.
		 -- Fred Allen




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

#82251 From: "Edward L. Fox" <edyfox@...>
Date: Mon Sep 3, 2007 4:22 pm
Subject: Re: Did someone use "gdbvim" or "idevim"
edyfox@...
Send Email Send Email
 
Hi another Fox,

On 9/3/07, Lazy Fox <lazy.fox.wu@...> wrote:
>
> I don't know how to use them, can you describe them for me?
>
> how to install and how to use with vim7?
>
> thanks!!!

The original author of gdbvim doesn't maintain it any longer. I
branched out once upon the time but now I don't maintain it either. I
recommend you using clewn. It's very handy. Check it out from
http://clewn.sourceforge.net/.

I have never used idevim before.

>
>
> >
>

Regards,

Edward L. Fox

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Messages 82222 - 82251 of 137765   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help