Re: unable to map ctrl-1

2009-03-31 Thread MisterW

On Apr 1, 3:14 pm, "John Beckett"  wrote:
> MisterW wrote:
> > Why then does vim.exe running in a cmd window allow me to map
> >  when gvim won't?
>
> George Reilly has just explained that Ctrl-6, Ctrl-2, Ctrl-- are
> special-cased in Windows (which I didn't know). Perhaps there is
> also some special casing for Ctrl-1 ... sorry, I don't know.

Doing some testing I have been unable to find a key that I cannot map
ctrl to on vim.exe in a command prompt.
ctrl 1-10 work as do = - ` / .

Can anyone explain why gvim.exe differs?

I'll have a look thru the source when I get a chance.

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



RE: unable to map ctrl-1

2009-03-31 Thread John Beckett

George V. Reilly wrote:
> If you look at process_message() in gui_w48.c (Windows Gvim)
> and decode_key_event() in os_win32.c (Win32 console Vim),
> you'll find some special-case handling:
> /* Ctrl-6 is Ctrl-^ */
> /* Ctrl-2 is Ctrl-@ */
> /* Ctrl-- is Ctrl-_ */
>
> I added the remapping hack for console Vim nearly 15 years
> ago, mostly because I couldn't stand typing Ctrl-Shift-6 to
> toggle between buffers.
>
> The other Ctrl- combinations are discarded,
> presumably because they have no ASCII equivalent.

Thanks for the interesting info. That is another corner of the
source that I haven't seen before.

John


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



RE: unable to map ctrl-1

2009-03-31 Thread John Beckett

MisterW wrote:
> Why then does vim.exe running in a cmd window allow me to map
>  when gvim won't?

George Reilly has just explained that Ctrl-6, Ctrl-2, Ctrl-- are
special-cased in Windows (which I didn't know). Perhaps there is
also some special casing for Ctrl-1 ... sorry, I don't know.

>> I know this news is a bit shocking, but I've found that as I
>> learned more of the Vim way of doing things, my desire to map
>> commands to weird character combinations has declined.
>
> Are you saying you don't make much use of mappings?
>
> I'm a long time vim user and I find there's an ever
> increasing list of things I want to map. I don't consider
> control 1-10 a wierd char combination, It's a fairly common
> idiom for switching between tabs and the like.

Sorry for the POV "weird" comment. It is true that I don't make
much use of key mappings (I certainly have some, but not for
buffer switching). Sometimes when I'm working on a particular
project I will put uppercase marks in files I want to quickly
return to. Or I might have a set of special mappings just for
the project (and I might use the keypad with stuff like ).

I'm sure you don't need this tip, but FWIW there is a tip that
maps:
,l   : list buffers
,b ,f ,g : go back/forward/last-used
,1 ,2 ,3 : go to buffer 1/2/3 etc
http://vim.wikia.com/wiki/Easier_buffer_switching

That is the sort of thing I would do given I can't use Ctrl-2
etc.

John


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



Re: unable to map ctrl-1

2009-03-31 Thread MisterW

> No. The problem is that Vim is designed to be portable; it works
> on many operating systems and tries to minimise the amount of
> special code used for dealing with a particular OS.

Why then does vim.exe running in a cmd window allow me to map 
when gvim won't?

> I know this news is a bit shocking, but I've found that as I
> learned more of the Vim way of doing things, my desire to map
> commands to weird character combinations has declined.

Are you saying you don't make much use of mappings?

I'm a long time vim user and I find there's an ever increasing list of
things I want to map. I don't consider control 1-10 a wierd char
combination, It's a fairly common idiom for switching between tabs and
the like.

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



Re: unable to map ctrl-1

2009-03-31 Thread George V. Reilly

On Tue, Mar 31, 2009 at 7:52 PM, John Beckett  wrote:
>
> MisterW wrote:
> > Gvim 72 on XP won't let me map certain ctrl key combinations.
> > Specifically it won't map any of CTRL 1 through to 10. If I
> > type
> >
> > CTRL-V CTRL-1
> >
> > I get nothing. Only 2 and 6 actually print anything. Other
> > applications make use of these keys, and vim itself uses
> > CTRL-6. Is there something that can be done to make this work?
>
> No. The problem is that Vim is designed to be portable; it works
> on many operating systems and tries to minimise the amount of
> special code used for dealing with a particular OS.
>
> It's not Ctrl-6, it is Ctrl-^ which is part of the venerable
> ASCII system. There is a lot more than you want to know at
> http://en.wikipedia.org/wiki/ASCII


If you look at process_message() in gui_w48.c (Windows Gvim) and
decode_key_event() in os_win32.c (Win32 console Vim), you'll find some
special-case handling:
/* Ctrl-6 is Ctrl-^ */
/* Ctrl-2 is Ctrl-@ */
/* Ctrl-- is Ctrl-_ */

I added the remapping hack for console Vim nearly 15 years ago, mostly
because I couldn't stand typing Ctrl-Shift-6 to toggle between
buffers.

The other Ctrl- combinations are discarded, presumably
because they have no ASCII equivalent.
-- 
/George V. Reilly  geo...@reilly.org
http://www.georgevreilly.com/blog  http://blogs.cozi.com/tech

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



RE: unable to map ctrl-1

2009-03-31 Thread John Beckett

MisterW wrote:
> Gvim 72 on XP won't let me map certain ctrl key combinations.
> Specifically it won't map any of CTRL 1 through to 10. If I
> type
>
> CTRL-V CTRL-1
>
> I get nothing. Only 2 and 6 actually print anything. Other
> applications make use of these keys, and vim itself uses
> CTRL-6. Is there something that can be done to make this work?

No. The problem is that Vim is designed to be portable; it works
on many operating systems and tries to minimise the amount of
special code used for dealing with a particular OS.

It's not Ctrl-6, it is Ctrl-^ which is part of the venerable
ASCII system. There is a lot more than you want to know at
http://en.wikipedia.org/wiki/ASCII

If you search for "^^" on that page (Ctrl-^) you will see the
list of valid Ctrl keys.

I know this news is a bit shocking, but I've found that as I
learned more of the Vim way of doing things, my desire to map
commands to weird character combinations has declined.

John


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



unable to map ctrl-1

2009-03-31 Thread MisterW

Gvim 72 on XP won't let me map certain ctrl key combinations.
Specifically it won't map any of CTRL 1 through to 10. If I type

CTRL-V CTRL-1

I get nothing. Only 2 and 6 actually print anything. Other
applications make use of these keys, and vim itself uses CTRL-6. Is
there something that can be done to make this work?

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



Re: Set the buffer name of a scratch buffer

2009-03-31 Thread Ben Fritz

> ===
> This email, including any attachments, is only for the intended
> addressee.  It is subject to copyright, is confidential and may be
> the subject of legal or other privilege, none of which is waived or
> lost by reason of this transmission.
> If the receiver is not the intended addressee, please accept our
> apologies, notify us by return, delete all copies and perform no
> other act on the email.
> Unfortunately, we cannot warrant that the email has not been
>  altered or corrupted during transmission.
> ===

Please see our mailing list guidelines:

http://groups.google.com/group/vim_use/web/vim-information

This legal mumbo jumbo means nothing (How exactly am I supposed to
return an email to the sender? Do you really want us to delete your
post, since I doubt this disclaimer covers the hundreds (thousands?)
on this list?) and is actually more annoying to me than top posting
ever will be.

If possible, please either disable this legalese on your messages to
this group, or post to this group from a personal email rather than
your company email.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: The list policy, AGAIN

2009-03-31 Thread Tony Mechelynck

On 31/03/09 18:43, Ben Fritz wrote:
>
>
>
> On Mar 31, 6:52 am, Tony Mechelynck
> wrote:
>>
>> I believe it wouldn't have been such a flood if you hadn't been so
>> adamant in defending top-posting as the only valid format, and later as
>> the only one available to you, because your (IMHO braindead) device
>> wastes everyone's bandwidth for the (egotistical) purpose of sparing
>> bandwidth between your device and its server.
>>
>
> It may be true that the lack of an option to control posting style on
> certain devices is a design flaw. However, it is not the fault of the
> user of such devices. I personally think we should make exceptions for
> those that top-post not out of ignorance, but rather out of a
> technical flaw. If I remember, Derek's first post that I responded to
> him about was actually a very useful tidbit of information, or at
> least exposed a common misconception. I don't think we should
> eliminate otherwise useful contributors simply because they can't
> follow our prescribed format.
>
>> As someone already said: get a real computer, in Rome do as the Romans,
>> and you won't be burned at the stake.
>>
>
> Perhaps, as someone has suggested, a better solution would be to not

the same one, IIRC.

> quote any text automatically at all. Or, use the web interface. Or,
> start each email with a statement like "I'm sorry for top-posting, I
> know this is not usual list procedure, but I can't configure my XXX
> device to bottom post" and a later responder can trim as needed.
>
> The final suggestion might be a bit controversial, but it does have
> some advantages:
>
> 1. It alerts us that the poster is trying to respect our policies, is
> unable to, but still wants to make a meaningful contribution
> 2. It alerts readers of the thread that we DO have policies, and they
> should follow them if possible
> 3. It does not drive away contributors for reasons (somewhat) beyond
> their control.
>
> I think making exceptions in rare cases like Derek's will help with
> the "polite" vs. "informative" balance.

OK.

>
> BTW, this is nothing to get emotional over...we're basically talking
> about which side of the bread to butter (if you've read obscure Dr.
> Suess books). Let's tone it down a little, Tony and Ivan.

Hm, well, maybe I did, er, how shall I say? grow a little enthusiastic 
about the matter. The couple of posts (some time before Derek's) which 
let out this whole flood were unusually bad, maybe even trollish now 
that I think about it, and I guess we all would have done better by "not 
feeding the animals". Well, what's done is  done, and IMHO the overall 
result is positive, even if to some people (such as Derek) it may not 
look that way. Have a nice day, folks, a nice Easter holiday, and let's 
all calm down and start afresh.


Best regards,
Tony.
-- 
"Drawing on my fine command of language, I said nothing."

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



Re: Hybrid Syntax File?

2009-03-31 Thread Rich Healey



On Apr 1, 3:49 am, Ben Fritz  wrote:
> On Mar 30, 11:17 pm, Rich Healey  wrote:
>
>
>
> > I’m writing trigger functions for my postgreSQL database using
> > plPython, what this means is that I want vim to highlight everything
> > up until a line with just
>
> > $BODY$
>
> > As SQL, then it should highlight everything until the next $BODY$ line
> > as Python.
>
> > The $BODY$ convention is mine, I would like longterm to make it a bit
> > more flexible so that I can distribute it without the ugly caveat of
> > having to adhere to my conventions.
>
> > I've got the sql.vim and python.vim files open and am looking through
> > them, but I can't see any obvious way to make it switch at the
> > markers.
>
> http://vim.wikia.com/wiki/Different_syntax_highlighting_within_region...
>
> By the way, I searched the wiki for "different syntax region" knowing
> I wanted this page, but it wasn't in the top hits.
>
> What search terms would people expect to use to find this file? We can
> create a few redirect pages to help you find it.

Thanks Ben,

That's exactly what I'm looking for. I'm also reassured that it wasn't
just me unable to find it.

Googlegroups reader is pretty useless.. tries to make me top post!

Thanks again for the help, I love reading this list, people are so
keen to help.

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



Re: Set the buffer name of a scratch buffer

2009-03-31 Thread guwegezo

On Apr 1, 12:07 pm, Tim Chase  wrote:
> > I have created a couple of scratch buffers:
>
> >     :setlocal buftype=nofile
> >     :setlocal bufhidden=hide
>
> > They appear in the buffer list as:
>
> >     :ls
> >     1 %a   "[Scratch]"                    line 1
> >     5 %a   "[Scratch]"                    line 1
>
> > Is there any way of setting the name of a scratch buffer?
>
> Does the following do what you're hunting?
>
>    :file some_meaningful_name
>    :ls
>
> -tim

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



Re: Set the buffer name of a scratch buffer

2009-03-31 Thread Tim Chase

> I have created a couple of scratch buffers:
> 
> :setlocal buftype=nofile
> :setlocal bufhidden=hide
> 
> They appear in the buffer list as:
> 
> :ls
> 1 %a   "[Scratch]"line 1
> 5 %a   "[Scratch]"line 1
> 
> Is there any way of setting the name of a scratch buffer? 

Does the following do what you're hunting?

   :file some_meaningful_name
   :ls

-tim




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



Set the buffer name of a scratch buffer

2009-03-31 Thread Douglas Royds

I have created a couple of scratch buffers:

:setlocal buftype=nofile
:setlocal bufhidden=hide

They appear in the buffer list as:

:ls
1 %a   "[Scratch]"line 1
5 %a   "[Scratch]"line 1

Is there any way of setting the name of a scratch buffer? The
special-buffers help says that, "The buffer name can be used to identify
the buffer", but that isn't terribly helpful when they are all called
simply "Scratch". I'd like to be able to give them meaningful names, without 
having them associated with a file.

Thanks,
Douglas.







===
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
===


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



RE: selecting a URL

2009-03-31 Thread Gene Kwiecinski

>>Not to sound flip about it, but there's only so much you can do to guard
>>against retardery.  If someone *insists* on including, bad enough
>>spaces, but *punctuation* into filenames and complete urls, then *he's*
>>the one with the problem.  Garbage in, garbage out.  If the link gets
>>screwed up so that it's broken (ie, can't click-through it), then too
>>bad.

>Well, it is standards-compliant. The same was once said about spaces
>in filenames, but look how common that is today. You and I may hate
>it, but so long as the RFC / filesystem supports punctuation in URLs /
>filenames then we can't complain when users use that feature.

Well, if an url is split across lines because of a space in a 
directory/filename, again, that's just too bad.  Ditto with urls that happen to 
require 6 video-lines of text to contain.  Hitting tinyurl.com to compress it 
to something manageable *shouldn't* be a requirement.


>>I always try to separate urls with at least a space, eg, at the end of a
>>sentence, so there's no confusion whether/not that trailing dot belongs.

>Be conservative with what you send, and liberal with waht you receive, no?

Generally, yeah.  The issue is *how* liberal you need to be to receive a valid 
url.


>>Me personally, I wouldn't worry about trying to contort a 'vim' script
>>to deal with crap like that.
>It depends on what the job was, I suppose.

Point being that no program, even a 'vim' script, can be perfect, and adding 
all sorts of preprocessing, postprocessing, regexp hacks, etc., to *try* to 
make sense of everything some ninny who things that having an entire 
article-title with ".htm" appended to it is a Good Idea for a weblink, is just 
foolhardy.  The added complexity can break *other* things if you're not 
careful, obfuscate the clear intent of the code, even open itself up for 
attacks.


>>But *publishers* (like wiki) who merge urls with other surrounding
>>text/punctuation?  That's unforgiveable.  Someone should edit the
>>page/entry itself to fix it.

>It's perfectly legal in the standards. You might want to try to change
>wikipedia policy, however.

Then they should be prepared to have things like

The page (http://fooey.com/waycoolarticle.htm) is awesome!

remain ambiguous, since the opening '(' *might* be spotted and disregarded as 
not part of the actual url, being before the "http:", but the trailing ')' 
*can* be considered part of the url or not, since it *would* be a valid part of 
the title, which is what I thought the OP's issue originally was.

At the *very* least, use

The page ( http://fooey.com/waycoolarticle.htm ) is awesome!

as I got into the habit of doing.  Then you can code for parens, squares, 
quotes, whatever some ninny decides to throw into an url just because it's 
"legal".

Again, ain't meaning to sound flip (or surly), but I've really had quite enough 
of those ninnies who generate garbage as their input data, then wonder why the 
program/script/filter/whatever chokes on it.  Eg, why is the url

http://fooey.com/AweSome Article About Nothing At All.htm

put through a filter to convert to a hot-link only makes

http://fooey.com/AweSome

the link in question.

Duh..

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



Re: selecting a URL

2009-03-31 Thread Dotan Cohen

> Not to sound flip about it, but there's only so much you can do to guard
> against retardery.  If someone *insists* on including, bad enough
> spaces, but *punctuation* into filenames and complete urls, then *he's*
> the one with the problem.  Garbage in, garbage out.  If the link gets
> screwed up so that it's broken (ie, can't click-through it), then too
> bad.
>

Well, it is standards-compliant. The same was once said about spaces
in filenames, but look how common that is today. You and I may hate
it, but so long as the RFC / filesystem supports punctuation in URLs /
filenames then we can't complain when users use that feature.



> I always try to separate urls with at least a space, eg, at the end of a
> sentence, so there's no confusion whether/not that trailing dot belongs.
>

Be conservative with what you send, and liberal with waht you receive, no?



> Me personally, I wouldn't worry about trying to contort a 'vim' script
> to deal with crap like that.
>

It depends on what the job was, I suppose.


> But *publishers* (like wiki) who merge urls with other surrounding
> text/punctuation?  That's unforgiveable.  Someone should edit the
> page/entry itself to fix it.
>

It's perfectly legal in the standards. You might want to try to change
wikipedia policy, however.


-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: selecting a URL

2009-03-31 Thread Paul

>There was an article on Codding Horror not long ago discussing this.
>What do you do if a URL ends in an end-parenthesis? It could be part
>of the url or not! Wikipedia is especially bad about this.

Thanks, that article's an interesting read (I found it here:
http://www.codinghorror.com/blog/archives/001181.html).
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: buffer or tab list in quick fix or location list?

2009-03-31 Thread _sc_

On Tuesday 31 March 2009 1:38 pm, Brian Dunn wrote:
> 
> hi list.
> is there a way to get a quick fix type window with links to all of my
> tabs or buffers?
> run :ls to list the buffers,
> remembering the number,
> run :b with the number,
> just seems like too many steps.

the easiest, leanest method is to define a map such as:

nmap  :ls:b

that way the list is right there and you don't have to remember the
number very long

one of the more popular plugins is BufExplorer -- if you don't mind
adding yet another plugin to your install, have a look at

  http://vim.sourceforge.net/scripts/script.php?script_id=42

then add something like

let g:bufExplorerSortBy='number'
nmap   :silent BufExplorer

to your .vimrc

sc


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



RE: selecting a URL

2009-03-31 Thread Gene Kwiecinski

>>Yeah, that would be very nice. I'm manually editing plain text into
>>HTML, and dealing with hundreds of unquoted URLs set into sentences
>>and terminated with periods, commas, dashes, unmatched closing parens,
>>and worse.

>There was an article on Codding Horror not long ago discussing this.
>What do you do if a URL ends in an end-parenthesis? It could be part
>of the url or not! Wikipedia is especially bad about this.

Not to sound flip about it, but there's only so much you can do to guard
against retardery.  If someone *insists* on including, bad enough
spaces, but *punctuation* into filenames and complete urls, then *he's*
the one with the problem.  Garbage in, garbage out.  If the link gets
screwed up so that it's broken (ie, can't click-through it), then too
bad.

I always try to separate urls with at least a space, eg, at the end of a
sentence, so there's no confusion whether/not that trailing dot belongs.

Me personally, I wouldn't worry about trying to contort a 'vim' script
to deal with crap like that.

But *publishers* (like wiki) who merge urls with other surrounding
text/punctuation?  That's unforgiveable.  Someone should edit the
page/entry itself to fix it.

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



Re: selecting a URL

2009-03-31 Thread Dotan Cohen

> Yeah, that would be very nice. I'm manually editing plain text into
> HTML, and dealing with hundreds of unquoted URLs set into sentences
> and terminated with periods, commas, dashes, unmatched closing parens,
> and worse.
>

There was an article on Codding Horror not long ago discussing this.
What do you do if a URL ends in an end-parenthesis? It could be part
of the url or not! Wikipedia is especially bad about this.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



Re: selecting a URL

2009-03-31 Thread Paul

> If you're really determined to do this, you could make your own text
> object to do it

Aha, I'll look into that, probably borrowing your code, Luc. Thanks
both!

>  In my experience, 99 times out of 100, URLs will either stand alone
> (in which case you could use diW) or be quoted (so you could use di").

Yeah, that would be very nice. I'm manually editing plain text into
HTML, and dealing with hundreds of unquoted URLs set into sentences
and terminated with periods, commas, dashes, unmatched closing parens,
and worse.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Using GetLatestVimScript Problems.

2009-03-31 Thread Edward Beach


On Mar 31, 1:33 pm, Charles Campbell 
wrote:
> Edward Beach wrote:
>
> > Actually I think I spoke too soon... I didn't notice before because
> > the error message gets cleared from view but when I disable shellslash
> > I get the follow errors on the AutoInstall...
>
> > considering <"AutoInstall: Decho.vim> scriptid=120 srcid=1
> > ...download new 
> > line 192:
> > E739: Cannot create directory C:/Documents\ and\ Settings/edward.beach/
> > vimfiles/GetLatest/Installed
> > line 221:
> > E484: Can't open file Decho.vba
> > line 237:
> > E344: Can't find directory "C:\Documents\ and\ Setting/edward.beach/
> > vimfiles/GetLatest in cdpath
> > E472: Command failed
>
> Your GetLatestVimScripts.dat file should not have any :AutoInstall:
> modifiers in it.
>
> Regards,
> Chip Campbell

I'm confused.  When I run GLVS, it modifies my GetLatestVimScripts.dat
and adds scripts entries with the :AutoInstall: in them.  For example,
with only the Decho package manually installed, if I remove all lines
from my GetLatestVimScripts.dat, i.e

ScriptID SourceID Filename
--

then it will add the following lines when i run GLVS:

120 9388 :AutoInstall: Decho.vim
1066 1 :AutoInstall: cecutil.vim

and it goes on to try to auto-install them.  Likewise, when I remove
the Decho package and pretty much have vim in a state akin to straight
out of the box, the GLVS commands adds the following lines:

642 8136 :AutoInstall: getscript.vim
1075 1 :AutoInstall: netrw.vim
1502 1 :AutoInstall: vimball.vim

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



buffer or tab list in quick fix or location list?

2009-03-31 Thread Brian Dunn


hi list.
is there a way to get a quick fix type window with links to all of my
tabs or buffers?
run :ls to list the buffers,
remembering the number,
run :b with the number,
just seems like too many steps.

i'm vim spoiled. : ) 

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



Re: buffer or tab list in quick fix or location list?

2009-03-31 Thread Brian Dunn

oops! sorry.
On Mar 31, 2009, at 11:25 AM, Ben Fritz wrote:

>
> If you have a new question, create a new message (do not reply to a
> message with a new question because all replies are kept in one
> thread).
>
> See our list guidelines at 
> http://groups.google.com/group/vim_use/web/vim-information
> >


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



Re: The list policy, AGAIN

2009-03-31 Thread Tim Chase

> start each email with a statement like "I'm sorry for top-posting, I
> know this is not usual list procedure, but I can't configure my XXX
> device to bottom post" and a later responder can trim as needed.

Heh, does "XXX" stand for profanity, or a make/model of device? ;-)

I too am more lenient when it comes to device limitations (no 
less irksome as a recipient, though at least more understandable) 
but I do agree with Ben's points:

> The final suggestion might be a bit controversial, but it does have
> some advantages:
> 
> 1. It alerts us that the poster is trying to respect our policies, is
> unable to, but still wants to make a meaningful contribution
> 2. It alerts readers of the thread that we DO have policies, and they
> should follow them if possible
> 3. It does not drive away contributors for reasons (somewhat) beyond
> their control.
> 
> I think making exceptions in rare cases like Derek's will help with
> the "polite" vs. "informative" balance.

It seems to boil down to a "my time as a querier is more valuable 
than your time as a respondent/answerer" attitude.  The more 
civil/respectful the querier is (in both text-content and in 
formatting), the more likely they'll get an answer.  Top-posting 
_can_ be done respectfully as Ben suggests, but the more adherent 
to list guidelines, the more respectful it is, and thus more 
likely the major players on the list will care.  I don't remember 
any grievous disrespect from Derek in the thread (I'd have to 
reach into my killfile to find the handful of folks I've had to 
plonk on this list...most have unsubscribed to the best of my 
knowledge.  The comp.lang.python list is the second best list I'm 
on in terms of [signal/civility]-to-noise, and my killfile from 
that is far longer)

-tim




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



Re: Using GetLatestVimScript Problems.

2009-03-31 Thread Charles Campbell

Edward Beach wrote:
>
> Actually I think I spoke too soon... I didn't notice before because
> the error message gets cleared from view but when I disable shellslash
> I get the follow errors on the AutoInstall...
>
> considering <"AutoInstall: Decho.vim> scriptid=120 srcid=1
> ...download new 
> line 192:
> E739: Cannot create directory C:/Documents\ and\ Settings/edward.beach/
> vimfiles/GetLatest/Installed
> line 221:
> E484: Can't open file Decho.vba
> line 237:
> E344: Can't find directory "C:\Documents\ and\ Setting/edward.beach/
> vimfiles/GetLatest in cdpath
> E472: Command failed
>   
Your GetLatestVimScripts.dat file should not have any :AutoInstall: 
modifiers in it.

Regards,
Chip Campbell



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



Re: selecting a URL

2009-03-31 Thread Matt Wozniski

On Tue, Mar 31, 2009 at 12:23 PM, Paul wrote:
>
> How would I go about making it easy for myself to select a string
> matching a complex regex, such as a URL? Ideally I'd like to be able
> to put my cursor into the middle of a line like
>
> http://vim.wikia.com/wiki/Special:Search?
> search=comments&go=1>search

It would be a lot easier here if this was valid XHTML, since then you
could just use di"

> and type "diu" and have Vim delete just the URL. And I'd like that to
> work regardless of the context where the URL is found.
>
> But a less perfectly streamlined solution would be fine too.
>
> Any suggestions?

If you're really determined to do this, you could make your own text
object to do it (there are some examples on the wiki), but I doubt it
would be that useful.  In my experience, 99 times out of 100, URLs
will either stand alone (in which case you could use diW) or be quoted
(so you could use di").  I rarely something like

foo=http://google.com

~Matt

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



Re: selecting a URL

2009-03-31 Thread Luc Hermitte

Hello,

"Paul"  wrote:

> How would I go about making it easy for myself to select a string
> matching a complex regex, such as a URL? Ideally I'd like to be able
> to put my cursor into the middle of a line like
> 
> http://vim.wikia.com/wiki/Special:Search?
> search=comments&go=1>search
> 
> and type "diu" and have Vim delete just the URL. And I'd like that to
> work regardless of the context where the URL is found.
> 
> But a less perfectly streamlined solution would be fine too.
> 
> Any suggestions?

I have an "old" command that I use to select URL and other path-like strings.
  http://code.google.com/p/lh-vim/source/browse/misc/trunk/_vimrc_win

>From this, you can define an :omap on "iu" that calls a function that is turns:
1- check the cursor is on a valid path
2- move the cursor to the beginning of the pattern
3- go into visual mode
4- move the cursor to the end of the pattern


See also 
http://code.google.com/p/lh-vim/source/browse/cpp/trunk/plugin/omap-param.vim 
for complex omap definitions.

HTH,

-- 
Luc Hermitte
http://lh-vim.googlecode.com/
http://hermitte.free.fr/vim/

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



Re: The list policy, AGAIN

2009-03-31 Thread Agathoklis D. Hatzimanikas

Hi Derek,

On Tue, Mar 31, at 02:28 de...@derekwyatt.org wrote:
 
> This topic has been more heavily posted on than anything else by far;

I agree.

> it's weaved its way into other topics as well and it has zip to do with Vim
> (posting off topic being far worse than the format of the message IMHO). 

I also agree.
 
> I joined this list to learn some sexy Vim bits and pieces after using it
> for 10+ years (Vi for another 5).  I got a couple of neat bits of
> information, but that's just a couple of drops in a sea of emails

Note however, that the people who regularly answer questions to this
list, all but all without an exception, they are bottom posters.

Here is my experience. While I usually following the list messages,
I don't always have the time to follow up with a suggestion immediately
and I might leave the answer that comes to mind, for a later time.
Well in that case, is much more easier to have the discussion in a linear
format, so I can follow it easier, rather (in the case of top posting)
than: try to guess or remember (the reference on the top of the email to
something which is not in front of my eyes), or to scroll down to the
message to find the referring (I do it but is annoying, especially when
it comes from someone who seeks for help - she has also to try to help
the participants with straight details and a nice formating text).
(It's not a typical exchange between some colleagues) 

> I posted a couple of times to try and be helpful and got personal emails in
> response telling me that I wasn't posting with a "nice format" - ugh, it's
> like living in a gated community where someone comes by to tell you that
> your red tulips aren't allowed, but yellow ones would be OK.

It might look like a rule and I think (based in the experience of life)
humans don't like rules in their lives (usually), but this isn't (a rule)
or it is a rule but for good reason. It's mostly practical as I've already
explained it, and a little of personal aesthetic (I admit it!).
And note again, that is a convention that is being used all over the Unix
lists for years (just try to top post in one of the main Gnu lists!).

> The hottest topic of conversation is how a post should be formatted,
> meaning that I could be harassed regularly if I don't post the way people
> like.  That's just silly :)

You have your opinion, and I don't like to enforce you my opinion, but
my opinion :) is that this conversation is not silly at all.
This is a community born from the need to exchange user experiences and to
help each other with our specialties.
Sometimes we have to talk for those boring things to reach in a consensus,
so we can understand each other better and make easier for people to
participate. By following those rules (well, just one and a half rule
actually) is mostly about respecting those people who share - you know
those valuable sexy bits and pieces - without even get paid just for the
sake of disinterestedness.. you know that inner human need, that make us
to feel better for unknown reasons. :) 

> I might follow things on the archive if the subjects are clear enough but
> as for staying as a member of the list... just can't be done.

Sure no problem. This list is one of the most civilized in the software
universe, but as someone (Teemu) already said and I agree with him, that
same list is getting sometimes unreadable (for the practical reasons I
mentioned above). Well, too many back references to my email. Hope it
doesn't get unreadable like Perl does sometimes. :)

> Cheers folks,
> Derek

Regards,
Agathoklis.

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



Re: Using GetLatestVimScript Problems.

2009-03-31 Thread Edward Beach

On Mar 31, 11:14 am, Charles Campbell 
wrote:
> Edward Beach wrote:
> > O
> > Thanks for the reply Chip,
>
> > You're right.  My problem is that I have shellslash enabled on a win32
> > build. Unfortunately setting the shellquote to " doesn't seem to
> > help.  Shellescape ignores the " and uses the ' regardless; it's only
> > when I disable shellslash that shellescape uses ".  So am I misusing
> > the shellslash setting?
>
> > As an aside...
> > :set shq='"' results in shellquote='
> > :set shq=\" resullts in shellquote="
>
> Sorry about the "'" and '"' stuff -- you're right.
>
> The help on 'shellslash' does mention that, when set, vim is expecting a
> unix-like shell
> (example: bash).  You probably shouldn't be using that option if you've
> got command.com or
> cmd.exe providing your shell services.
>
> Regards,
> Chip Campbell

Actually I think I spoke too soon... I didn't notice before because
the error message gets cleared from view but when I disable shellslash
I get the follow errors on the AutoInstall...

considering <"AutoInstall: Decho.vim> scriptid=120 srcid=1
...download new 
line 192:
E739: Cannot create directory C:/Documents\ and\ Settings/edward.beach/
vimfiles/GetLatest/Installed
line 221:
E484: Can't open file Decho.vba
line 237:
E344: Can't find directory "C:\Documents\ and\ Setting/edward.beach/
vimfiles/GetLatest in cdpath
E472: Command failed

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



Re: Hybrid Syntax File?

2009-03-31 Thread Ben Fritz



On Mar 30, 11:17 pm, Rich Healey  wrote:
> I’m writing trigger functions for my postgreSQL database using
> plPython, what this means is that I want vim to highlight everything
> up until a line with just
>
> $BODY$
>
> As SQL, then it should highlight everything until the next $BODY$ line
> as Python.
>
> The $BODY$ convention is mine, I would like longterm to make it a bit
> more flexible so that I can distribute it without the ugly caveat of
> having to adhere to my conventions.
>
> I've got the sql.vim and python.vim files open and am looking through
> them, but I can't see any obvious way to make it switch at the
> markers.
>

http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file

By the way, I searched the wiki for "different syntax region" knowing
I wanted this page, but it wasn't in the top hits.

What search terms would people expect to use to find this file? We can
create a few redirect pages to help you find it.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: The list policy, AGAIN

2009-03-31 Thread Ben Fritz



On Mar 31, 6:52 am, Tony Mechelynck 
wrote:
>
> I believe it wouldn't have been such a flood if you hadn't been so
> adamant in defending top-posting as the only valid format, and later as
> the only one available to you, because your (IMHO braindead) device
> wastes everyone's bandwidth for the (egotistical) purpose of sparing
> bandwidth between your device and its server.
>

It may be true that the lack of an option to control posting style on
certain devices is a design flaw. However, it is not the fault of the
user of such devices. I personally think we should make exceptions for
those that top-post not out of ignorance, but rather out of a
technical flaw. If I remember, Derek's first post that I responded to
him about was actually a very useful tidbit of information, or at
least exposed a common misconception. I don't think we should
eliminate otherwise useful contributors simply because they can't
follow our prescribed format.

> As someone already said: get a real computer, in Rome do as the Romans,
> and you won't be burned at the stake.
>

Perhaps, as someone has suggested, a better solution would be to not
quote any text automatically at all. Or, use the web interface. Or,
start each email with a statement like "I'm sorry for top-posting, I
know this is not usual list procedure, but I can't configure my XXX
device to bottom post" and a later responder can trim as needed.

The final suggestion might be a bit controversial, but it does have
some advantages:

1. It alerts us that the poster is trying to respect our policies, is
unable to, but still wants to make a meaningful contribution
2. It alerts readers of the thread that we DO have policies, and they
should follow them if possible
3. It does not drive away contributors for reasons (somewhat) beyond
their control.

I think making exceptions in rare cases like Derek's will help with
the "polite" vs. "informative" balance.

BTW, this is nothing to get emotional over...we're basically talking
about which side of the bread to butter (if you've read obscure Dr.
Suess books). Let's tone it down a little, Tony and Ivan.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Regex substitute only outside "strings"

2009-03-31 Thread ivan budiselic
On Tue, Mar 31, 2009 at 4:40 PM, A. S. Budden  wrote:

>
> 2009/3/31 ivan budiselic :
> > On Tue, Mar 31, 2009 at 10:13 AM, Andreas Bernauer 
> > wrote:
> >>
> >> ivan budiselic wrote:
> >> >>> So, for the line:
> >> >>>
> >> >>> 1234 a a "a" a
> >> >>>
> >> >>> I'd like to get:
> >> >>>
> >> >>> 1234 b b "a" b
> >> >>>
> >> >>> The question is, is this possible and how.
> >> >>>
> >> >>> What I've tried is
> >> >>> let line = substitute(line, '\([^\"]\{-}\)a', "\\1b", "g")
> >> >>
> >> >> ...because \{-} matches also 0 times; what you wanted is \{-1,}:
> >> >>
> >> >> let line = substitute('123 a "a" a', '\([^"]\{-1,}\)a', '\1b', 'g')
> >> >>
> >> >
> >> > Ok, this worked pretty well, except that it doesn't work for cases
> when
> >> > there's an 'a' at the start of the line (which I might be able to
> fix),
> >> > and
> >>
> >> Allow matching 'start-of-line' (^) in front of 'a', too; see below.
> >>
> >> > the other problem which I wasn't specific enough about, and that is
> that
> >> > I'd
> >> > like the change to happen to 'a's outside of strings, so for example
> >> > "xxxaxxx" shouldn't match. I guess this changes things quite a bit,
> >> > sorry
> >> > for not being clear enough.
> >>
> >> So, would you like further help? If yes, could you provide an example
> for
> >> what
> >> you want to achieve?
> >>
> >> s/\(^\|\s\)\zsa\ze\s\?/b/
> >> works for
> >> a 123 a a "axxx" a
> >> ==>
> >> b 123 b b "axxx" b
> >
> > Ok, so a complete example would be this:
> >
> > a 123 a "xy a xax xa a" xa ax xax "a" " a " " xa ax xax " a
> >
> > should result in
> >
> > b 123 b "xy a xax xa a" xb bx xbx "a" " a " " xa ax axa " b
> >
> > In words, all occurrences of 'a' outside of double quotes change to b,
> and
> > all occurrences of 'a' inside double qoutes stay uncanged.
> >
> > The line you suggested doesn't handle the quotes. What I tried now is:
> >
> > let line = substitute(line, '^\%([^"]\|.\{-}".\{-}".\{-}\)\{-}\zsa\ze',
> 'b',
> > 'g')
> >
> > Now, the problem I'm having is that I'm obviously missunderstanding the
> 'g'
> > flag. This line does what I want, but only does the substitution for the
> > first 'a' (so I can solve the problem by running it multiple times, until
> a
> > match is possible, which is what I thought the 'g' flag is supposed to
> do).
> [snip]
>
> The 'g' flag will perform as many substitutions as match on the line
> in a single attempt.  Therefore, it will only match once if the
> pattern contains '^' as it will match at the start of the line.  If
> you consider the effect of how you expect it to work, given a string:
>
> bbbabab
>
> If you did s/a/aa/g and it kept trying until it couldn't match, the
> first attempt would make
>
> bbbaabab
>
> the second:
>
> bbbaaabab
>
> and so on until the computer gives up in an infinite-loop induced
> panic.  Therefore, if you can imagine that the list of matches is
> found (in this case character 4 and 6) and THEN each instance is
> replaced, giving bbbaabaab.
>
> I'm not sure of a good regular expression to do what you want, but it
> might be simplest to use a construct like:
>
> while match(line, regexp) != -1
>let line = substitute(line, regexp, subpattern, '')
> endwhile
>
> Just make sure that the result of the substitution can never create a
> situation in which the regexp will match, or you'll be in an infinite
> loop again.
>

That's what I'll probably end up doing. Thanks.

Ivan

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



Re: buffer or tab list in quick fix or location list?

2009-03-31 Thread Ben Fritz

If you have a new question, create a new message (do not reply to a
message with a new question because all replies are kept in one
thread).

See our list guidelines at 
http://groups.google.com/group/vim_use/web/vim-information
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



selecting a URL

2009-03-31 Thread Paul

How would I go about making it easy for myself to select a string
matching a complex regex, such as a URL? Ideally I'd like to be able
to put my cursor into the middle of a line like

http://vim.wikia.com/wiki/Special:Search?
search=comments&go=1>search

and type "diu" and have Vim delete just the URL. And I'd like that to
work regardless of the context where the URL is found.

But a less perfectly streamlined solution would be fine too.

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



Re: setting vim tabline

2009-03-31 Thread Erik Falor

On Tue, Mar 31, 2009 at 02:28:12PM +0300, Nicolas Aggelidis wrote:

> hi to all the list! a fellow vimmer (from the list) has posted the
> following tabline for gvim [i don't recall if it was exactly the
> same]:
> 

[code snipped...]

> 
> this function ,works great for gvim, but when i try to use it with
> vim, i get the following errors:
> 
> Error detected while processing function VimTabLabel:
> line5:
> E714: List required

On line 5 of the function, the variable v:lnum was referenced.
>From :help v:lnum:
*v:lnum* *lnum-variable*
v:lnum  Line number for the 'foldexpr' |fold-expr| and 'indentexpr'
expressions, tab page number for 'guitablabel' and
'guitabtooltip'.  Only valid while one of these expressions is
being evaluated.  Read-only when in the |sandbox|.

The problem was that guitablabel isn't called from within console Vim,
so v:lnum doesn't have a valid value for the purposes of
tabpagebuflist().

> is there any way to convert it for vim?

Not really.  There isn't an analog to the 'guitablabel' setting in
console Vim.  The closest thing is 'tabline', which operates rather
differently.  Instead of writing a function which makes one label at a
time, in console Vim you build the tabline in one shot.

Read up on it:
:help tabline

There's a nice example in the docs that you can tweak to your liking.

-- 
Erik Falor
Registered Linux User #445632 http://counter.li.org

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



Re: Using GetLatestVimScript Problems.

2009-03-31 Thread Charles Campbell

Edward Beach wrote:
> O
> Thanks for the reply Chip,
>
> You're right.  My problem is that I have shellslash enabled on a win32
> build. Unfortunately setting the shellquote to " doesn't seem to
> help.  Shellescape ignores the " and uses the ' regardless; it's only
> when I disable shellslash that shellescape uses ".  So am I misusing
> the shellslash setting?
>
> As an aside...
> :set shq='"' results in shellquote='
> :set shq=\" resullts in shellquote="
>   
Sorry about the "'" and '"' stuff -- you're right.

The help on 'shellslash' does mention that, when set, vim is expecting a 
unix-like shell
(example: bash).  You probably shouldn't be using that option if you've 
got command.com or
cmd.exe providing your shell services.

Regards,
Chip Campbell


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



Re: Regex substitute only outside "strings"

2009-03-31 Thread A. S. Budden

2009/3/31 ivan budiselic :
> On Tue, Mar 31, 2009 at 10:13 AM, Andreas Bernauer 
> wrote:
>>
>> ivan budiselic wrote:
>> >>> So, for the line:
>> >>>
>> >>> 1234 a a "a" a
>> >>>
>> >>> I'd like to get:
>> >>>
>> >>> 1234 b b "a" b
>> >>>
>> >>> The question is, is this possible and how.
>> >>>
>> >>> What I've tried is
>> >>> let line = substitute(line, '\([^\"]\{-}\)a', "\\1b", "g")
>> >>
>> >> ...because \{-} matches also 0 times; what you wanted is \{-1,}:
>> >>
>> >> let line = substitute('123 a "a" a', '\([^"]\{-1,}\)a', '\1b', 'g')
>> >>
>> >
>> > Ok, this worked pretty well, except that it doesn't work for cases when
>> > there's an 'a' at the start of the line (which I might be able to fix),
>> > and
>>
>> Allow matching 'start-of-line' (^) in front of 'a', too; see below.
>>
>> > the other problem which I wasn't specific enough about, and that is that
>> > I'd
>> > like the change to happen to 'a's outside of strings, so for example
>> > "xxxaxxx" shouldn't match. I guess this changes things quite a bit,
>> > sorry
>> > for not being clear enough.
>>
>> So, would you like further help? If yes, could you provide an example for
>> what
>> you want to achieve?
>>
>> s/\(^\|\s\)\zsa\ze\s\?/b/
>> works for
>> a 123 a a "axxx" a
>> ==>
>> b 123 b b "axxx" b
>
> Ok, so a complete example would be this:
>
> a 123 a "xy a xax xa a" xa ax xax "a" " a " " xa ax xax " a
>
> should result in
>
> b 123 b "xy a xax xa a" xb bx xbx "a" " a " " xa ax axa " b
>
> In words, all occurrences of 'a' outside of double quotes change to b, and
> all occurrences of 'a' inside double qoutes stay uncanged.
>
> The line you suggested doesn't handle the quotes. What I tried now is:
>
> let line = substitute(line, '^\%([^"]\|.\{-}".\{-}".\{-}\)\{-}\zsa\ze', 'b',
> 'g')
>
> Now, the problem I'm having is that I'm obviously missunderstanding the 'g'
> flag. This line does what I want, but only does the substitution for the
> first 'a' (so I can solve the problem by running it multiple times, until a
> match is possible, which is what I thought the 'g' flag is supposed to do).
[snip]

The 'g' flag will perform as many substitutions as match on the line
in a single attempt.  Therefore, it will only match once if the
pattern contains '^' as it will match at the start of the line.  If
you consider the effect of how you expect it to work, given a string:

bbbabab

If you did s/a/aa/g and it kept trying until it couldn't match, the
first attempt would make

bbbaabab

the second:

bbbaaabab

and so on until the computer gives up in an infinite-loop induced
panic.  Therefore, if you can imagine that the list of matches is
found (in this case character 4 and 6) and THEN each instance is
replaced, giving bbbaabaab.

I'm not sure of a good regular expression to do what you want, but it
might be simplest to use a construct like:

while match(line, regexp) != -1
let line = substitute(line, regexp, subpattern, '')
endwhile

Just make sure that the result of the substitution can never create a
situation in which the regexp will match, or you'll be in an infinite
loop again.

An alternative way to do what you want would be to split the string on
the double quote character and then run a much simpler regular
expression on every other part:

" Split into component parts (keeping empty entries)
let components = split(line, '"', 1)

" Iterate through every other entry running substitution
let index = 0
while index < len(components)
let components[index] = substitute(components[index], 'a', 'b', 'g')
let index += 2
endwhile

" Recombine entries
let new_version_of_line = join(components, '"')

" (Untested)

Hope that helps a little.

Al

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



Re: Using GetLatestVimScript Problems.

2009-03-31 Thread Edward Beach

On Mar 31, 9:58 am, Charles Campbell 
wrote:
> Edward Beach wrote:
> > Thanks for the reply, Chip.
>
> > * I can execute :!dir and even :!wget and :execute "silent r!wget" but
> > I fail at executing :execute silent r!dir
>
> > * Version dump:
> > VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Aug  9 2008 18:46:22)
>
> [snip]
>
> OK, 7.2 is good (although there've been 148 patches since it came out).  
> I was mostly
> interested if you're using a vim with shellescape().  Presumably a
>   :echo  exists("*shellescape")
> should show "1" (ie. that it does support shellescape()).
>
> So, what does
>    :echo shellescape("abc")
> show?> * I'm using the distribution's version, marked as v31.  But I replaced
> > that version with 32b and I still have the same problems.
>
> > * From the dos cmd window, I can execute the command...but I need to
> > switch the single quotes(') wrapping the file paths with double quotes
> > (").
>
> What does
>    :echo shellescape("abc")
> show?   I suspect you'll see
>   'abc'
> rather than
>   "abc"
>
> If so, more questions: what do
>   :echo &shell
> and
>   :echo &shq
> show?  Does
>   :set shq='"'
> fix the problem?
>
> Regards,
> Chip Campbell

Thanks for the reply Chip,

You're right.  My problem is that I have shellslash enabled on a win32
build. Unfortunately setting the shellquote to " doesn't seem to
help.  Shellescape ignores the " and uses the ' regardless; it's only
when I disable shellslash that shellescape uses ".  So am I misusing
the shellslash setting?

As an aside...
:set shq='"' results in shellquote='
:set shq=\" resullts in shellquote="

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



buffer or tab list in quick fix or location list?

2009-03-31 Thread Brian Dunn

hi list.
is there a way to get a quick fix type window with links to all of my  
tabs or buffers?
run :ls to list the buffers,
remembering the number,
run :b with the number,
just seems like too many steps.

i'm vim spoiled. : ) 
   

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



Re: Using GetLatestVimScript Problems.

2009-03-31 Thread Charles Campbell

Edward Beach wrote:
> Thanks for the reply, Chip.
>
> * I can execute :!dir and even :!wget and :execute "silent r!wget" but
> I fail at executing :execute silent r!dir
>
> * Version dump:
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Aug  9 2008 18:46:22)
>
>   
[snip]

OK, 7.2 is good (although there've been 148 patches since it came out).  
I was mostly
interested if you're using a vim with shellescape().  Presumably a
  :echo  exists("*shellescape")
should show "1" (ie. that it does support shellescape()).

So, what does
   :echo shellescape("abc")
show? 
> * I'm using the distribution's version, marked as v31.  But I replaced
> that version with 32b and I still have the same problems.
>
> * From the dos cmd window, I can execute the command...but I need to
> switch the single quotes(') wrapping the file paths with double quotes
> (").
>   
What does
   :echo shellescape("abc")
show?   I suspect you'll see
  'abc'
rather than
  "abc"

If so, more questions: what do
  :echo &shell
and
  :echo &shq
show?  Does
  :set shq='"'
fix the problem?

Regards,
Chip Campbell


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



Re: How to redraw the whole vim screen after splitting new windows?

2009-03-31 Thread Charles Campbell

Clark J. Wang wrote:
> The following steps can reproduce the issue for vim 7.2.69:
>
> vim -u NONE -N
> :set laststatus=2
> :set statusline=%{winnr()}
> :vsplit
> :split
>
> I tested with an old vim-6.3.30 on Fedora 3 but it worked fine so
> different versions of vim behave differently.
>   
Hello!

I see this problem in 7.2.148 -- and so I've sent a copy of the problem 
along with
how to reproduce it to Bram.

Regards,
Chip Campbell


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



Re: How to customize comment style?

2009-03-31 Thread Abhishek Gupta
Hi,


>
>> while the defalt comment style is
>>
>> /*
>>  *
>>  *
>>  */
>>
>>
> To remove this comment style use:
> autocmd FileType c,cpp set comments-=s1:/*,mb:**,ex:*/
>
>
Sorry .. this should be:
autocmd FileType c,cpp set comments-=s1:/*,mb:*,ex:*/

Forgot to remove the extra * from middle portion of the comment.

Regards,
Abhishek

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



Re: The list policy, AGAIN

2009-03-31 Thread Tony Mechelynck

On 31/03/09 14:08, Ivan Van Laningham wrote:
>
> On Tue, Mar 31, 2009 at 5:52 AM, Tony Mechelynck
> mailto:antoine.mechely...@gmail.com>> wrote:
>
>
> On 31/03/09 11:28, de...@derekwyatt.org
>  wrote:
> [...]
>  > I think this is my cue to leave :)
>  >
>  > This topic has been more heavily posted on than anything else by
> far; it's
>  > weaved its way into other topics as well and it has zip to do
> with Vim
>  > (posting off topic being far worse than the format of the message
> IMHO).
>  > Not only that... this is just my opinion but I think you might
> need to
>  > relax about this stuff - just let people post text and be done
> with it -
>  > the human brain can handle top/bottom/middle posting without too much
>  > trouble. :)
>  >
>  > I joined this list to learn some sexy Vim bits and pieces after
> using it
>  > for 10+ years (Vi for another 5).  I got a couple of neat bits of
>  > information, but that's just a couple of drops in a sea of emails - I
>  > posted a couple of times to try and be helpful and got personal
> emails in
>  > response telling me that I wasn't posting with a "nice format" -
> ugh, it's
>  > like living in a gated community where someone comes by to tell
> you that
>  > your red tulips aren't allowed, but yellow ones would be OK.
>  >
>  > The hottest topic of conversation is how a post should be formatted,
>  > meaning that I could be harassed regularly if I don't post the
> way people
>  > like.  That's just silly :)
>  >
>  > I might follow things on the archive if the subjects are clear
> enough but
>  > as for staying as a member of the list... just can't be done.
>  >
>  > Cheers folks,
>  > Derek
>
> I believe it wouldn't have been such a flood if you hadn't been so
> adamant in defending top-posting as the only valid format, and later as
> the only one available to you, because your (IMHO braindead) device
> wastes everyone's bandwidth for the (egotistical) purpose of sparing
> bandwidth between your device and its server.
>
> As someone already said: get a real computer, in Rome do as the Romans,
> and you won't be burned at the stake.
>
>
>
>
> Regards,
> Tony.
>
>
>
> Oh, please.  Out of 28 posts in this thread, only two have been from
> Derek.  In his first post, he did not defend "top-posting as the only
> valid format," merely commented that Blackberries didn't allow
> bottom-posting.  In his second post, he pointed out that list traffic
> over the last week or so has mostly been about the evils of top-posting,
> with precious little about vim.  Please don't twist the facts to suit
> your agenda.
>
> The Roman Empire fell in 476.
>
> Metta,
> Ivan

Sorry, I didn't "twist the facts to suit my agenda", what happened is 
that I "honestly misremembered" who had posted the original "defense of 
top-posting" which caused all this flood. Go back to Jeff Lanzarotta's's 
post titled "Re: IntelliSense for C#" dated 28/03/09 12:37 -0700, which 
went as far as saying that "the most annoying thing on the Internet is 
not replying at the *top* of an email, it is rude people." and you will 
see that this discussion didn't materialize out of thin air, especially 
since there was another post (which I can't find back at the moment, 
maybe in a different thread) with a "defense" of top-posting in several 
points, one of which amounted to "I can't be bothered to do otherwise 
than Outlook Express's defaults" (and since I'm quoting from memory, it 
may not be the exact phrasing he used).

And by the way, next time you might go so far as posting in plaintext, I 
believe it's another "preferred format" on this list.


Best regards,
Tony.
-- 
The chief cause of problems is solutions.

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



Re: How to customize comment style?

2009-03-31 Thread Abhishek Gupta
Hi Loudking,

You can check your existing comment styles by
:set comments


> My manager prefers comments in C files in this style
>
> /*
> **
> **
> */
>

To add this comment style for c,cpp:
autocmd FileType c,cpp set comments+=s:/*,mb:**,ex:*/


> while the defalt comment style is
>
> /*
>  *
>  *
>  */
>
>
To remove this comment style use:
autocmd FileType c,cpp set comments-=s1:/*,mb:**,ex:*/

Check :h comments and :h format-comments for details.

You will also need to make sure that your formatoptions has the following:
croq
Check :h fo-table for details

Regards,
Abhishek

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



Re: How to redraw the whole vim screen after splitting new windows?

2009-03-31 Thread John Little

> The following steps can reproduce the issue for vim 7.2.69:
>
> vim -u NONE -N
> :set laststatus=2
> :set statusline=%{winnr()}
> :vsplit
> :split

I see this (two windows with status line set to "2") with 7.2.141 and
7.1.314.

I noticed that to see the problem, the :split has to be in window 1.
My .vimrc has set splitright, which puts the cursor in window 2; if I
move it back, then :split, then it happens.  A redraw fixes it.

Regards, John

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



Re: The list policy, AGAIN

2009-03-31 Thread Ivan Van Laningham
On Tue, Mar 31, 2009 at 5:52 AM, Tony Mechelynck <
antoine.mechely...@gmail.com> wrote:

>
> On 31/03/09 11:28, de...@derekwyatt.org wrote:
> [...]
> > I think this is my cue to leave :)
> >
> > This topic has been more heavily posted on than anything else by far;
> it's
> > weaved its way into other topics as well and it has zip to do with Vim
> > (posting off topic being far worse than the format of the message IMHO).
> > Not only that... this is just my opinion but I think you might need to
> > relax about this stuff - just let people post text and be done with it -
> > the human brain can handle top/bottom/middle posting without too much
> > trouble. :)
> >
> > I joined this list to learn some sexy Vim bits and pieces after using it
> > for 10+ years (Vi for another 5).  I got a couple of neat bits of
> > information, but that's just a couple of drops in a sea of emails - I
> > posted a couple of times to try and be helpful and got personal emails in
> > response telling me that I wasn't posting with a "nice format" - ugh,
> it's
> > like living in a gated community where someone comes by to tell you that
> > your red tulips aren't allowed, but yellow ones would be OK.
> >
> > The hottest topic of conversation is how a post should be formatted,
> > meaning that I could be harassed regularly if I don't post the way people
> > like.  That's just silly :)
> >
> > I might follow things on the archive if the subjects are clear enough but
> > as for staying as a member of the list... just can't be done.
> >
> > Cheers folks,
> > Derek
>
> I believe it wouldn't have been such a flood if you hadn't been so
> adamant in defending top-posting as the only valid format, and later as
> the only one available to you, because your (IMHO braindead) device
> wastes everyone's bandwidth for the (egotistical) purpose of sparing
> bandwidth between your device and its server.
>
> As someone already said: get a real computer, in Rome do as the Romans,
> and you won't be burned at the stake.
>



>
>
> Regards,
> Tony.



Oh, please.  Out of 28 posts in this thread, only two have been from Derek.
In his first post, he did not defend "top-posting as the only valid format,"
merely commented that Blackberries didn't allow bottom-posting.  In his
second post, he pointed out that list traffic over the last week or so has
mostly been about the evils of top-posting, with precious little about vim.
Please don't twist the facts to suit your agenda.

The Roman Empire fell in 476.

Metta,
Ivan
--
Ivan Van Laningham
God N Locomotive Works
http://www.pauahtun.org/
http://www.python.org/workshops/1998-11/proceedings/papers/laningham/laningham.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours

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



Re: The list policy, AGAIN

2009-03-31 Thread Tony Mechelynck

On 31/03/09 11:28, de...@derekwyatt.org wrote:
[...]
> I think this is my cue to leave :)
>
> This topic has been more heavily posted on than anything else by far; it's
> weaved its way into other topics as well and it has zip to do with Vim
> (posting off topic being far worse than the format of the message IMHO).
> Not only that... this is just my opinion but I think you might need to
> relax about this stuff - just let people post text and be done with it -
> the human brain can handle top/bottom/middle posting without too much
> trouble. :)
>
> I joined this list to learn some sexy Vim bits and pieces after using it
> for 10+ years (Vi for another 5).  I got a couple of neat bits of
> information, but that's just a couple of drops in a sea of emails - I
> posted a couple of times to try and be helpful and got personal emails in
> response telling me that I wasn't posting with a "nice format" - ugh, it's
> like living in a gated community where someone comes by to tell you that
> your red tulips aren't allowed, but yellow ones would be OK.
>
> The hottest topic of conversation is how a post should be formatted,
> meaning that I could be harassed regularly if I don't post the way people
> like.  That's just silly :)
>
> I might follow things on the archive if the subjects are clear enough but
> as for staying as a member of the list... just can't be done.
>
> Cheers folks,
> Derek

I believe it wouldn't have been such a flood if you hadn't been so 
adamant in defending top-posting as the only valid format, and later as 
the only one available to you, because your (IMHO braindead) device 
wastes everyone's bandwidth for the (egotistical) purpose of sparing 
bandwidth between your device and its server.

As someone already said: get a real computer, in Rome do as the Romans, 
and you won't be burned at the stake.


Regards,
Tony.
-- 
Think of it!  With VLSI we can pack 100 ENIACs in 1 sq. cm.!

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



Updating status line of inactive windows

2009-03-31 Thread François Ingelrest

Hi all,

In my status line, I display the number of lines in the corresponding
buffer. If I split the window, so that I have the same buffer into two
visible windows, only the status line of the active window is updated.
For instance, if I add some new lines to the buffer, the number of
lines in the inactive windows remains the same.

Even more confusing: If I change the file type, the syntax
highlighting is updated in both windows, but only the file type in the
status line of the active window is updated, not the other one.

Is it the expected behavior? I would have expected the other status
line to be updated, even if the corresponding window is inactive,
since it's the same buffer I'm modifying.

BTW, I'm using Vim 7.2.148 on Ubuntu Linux.

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



setting vim tabline

2009-03-31 Thread Nicolas Aggelidis

hi to all the list! a fellow vimmer (from the list) has posted the
following tabline for gvim [i don't recall if it was exactly the
same]:

function! VimTabLabel()
 let label = ''
 let bufnrlist = tabpagebuflist(v:lnum)

 " Add '+' if one of the buffers in the tab page is modified
 for bufnr in bufnrlist
   if getbufvar(bufnr, "&modified")
 let label = '+'
 break
   endif
 endfor

 " Append the tab number
 let label .= tabpagenr().': '

 " Append the buffer name
 let name = bufname(bufnrlist[tabpagenr(v:lnum) - 1])
 if name == ''
   " give a name to no-name documents
   if &buftype=='quickfix'
 let name = '[Quickfix List]'
   else
 let name = '[No Name]'
   endif
 else
   " get only the file name
   let name = fnamemodify(name,":t")
 endif
 let label .= name

  Append the number of windows in the tab page
 let wincount = tabpagewinnr(v:lnum, '$')
 return label . '  [' . wincount . ']'

endfunction

this function ,works great for gvim, but when i try to use it with
vim, i get the following errors:

Error detected while processing function VimTabLabel:
line5:
E714: List required
line   16:
E15: Invalid expression: 0
Press ENTER or type command to continue

is there any way to convert it for vim?

thanks in advance for any help,
nicolas

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



Re: How to redraw the whole vim screen after splitting new windows?

2009-03-31 Thread Clark J. Wang

On Mar 30, 10:38 pm, Charles Campbell 
wrote:
> Clark J. Wang wrote:
> > On Mar 27, 7:16 pm, "Clark J. Wang"  wrote:
>
> >> I included %{winnr()} in the var `statusline'. But sometimes when I
> >> splitted new windows the winnr() string on screen was not updated
> >> (try :vsplit and then :split). So I want to call `redraw' when I split
> >> new windows but I failed to find an autocmd for that.
>
> > Any idea?
>
> Hello:
>
> I don't see any problems with %{winnr()}.  I'm normally use a rather
> more involved statusline setting than just %{winnr()}, but with just
>
>   :set stl=%{winnr()}
>   :vsplit
>   :split
>
> the window numbers are all updated properly.  I then used:
>
>   vim -u NONE -N
>   :set nocp
>   :filetype plugin on
>   :set stl=%{winnr()}
>   :vsplit
>   :split
>
> and, again, all the window numbers are  updated properly (without
> recourse to ctrl-l or :redraw).
>
> So: please give a detailed sequence of commands that causes a lack of
> updated status line(s), preferably using  vim -u NONE -N to avoid any
> entanglements with your current .vimrc settings.
>
> Regards,
> Chip Campbell

The following steps can reproduce the issue for vim 7.2.69:

vim -u NONE -N
:set laststatus=2
:set statusline=%{winnr()}
:vsplit
:split

I tested with an old vim-6.3.30 on Fedora 3 but it worked fine so
different versions of vim behave differently.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: How to define a function with optional arguments?

2009-03-31 Thread Clark J. Wang

On Mar 31, 6:14 pm, Tim Chase  wrote:
> > Some built-in vim functions support optional arguments. For example,
> > we can write winnr() as well as winnr('$'). Can I define my own
> > functions with optional arguments? I found no hints in vim's online
> > help.
>
> The relevant help is at
>
>    :help a:0
>
> (it's another of those "it's easy to find if you already know
> what you're looking for" sorts of help bits :)
>
> You can have up to 20 arguments by putting "..." in your function
> specification's parameters, and then referencing it with "a:1",
> "a:2", etc.  Or, you can access them as a list using "a:000".
> The number of arguments passed is contained in "a:0".
>
> -tim
Got it. Thanks a lot.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



RE: [vim script] How to define a function with optional arguments?

2009-03-31 Thread John Beckett

Clark J. Wang wrote:
> Some built-in vim functions support optional arguments.
> For example, we can write winnr() as well as winnr('$').
> Can I define my own functions with optional arguments?

Yes. When desperate, try something like this to search Help:

  :helpgrep \coptional.*arg

That does a case-insensitive (\c) search for all lines
containing "optional" followed by "arg". There are a lot of hits
you don't want, but then you find:

  :help function-argument

There are a few details about getting it working, and I have
seen different approaches. There are couple of techniques which
work well in the scripts in these tips:

http://vim.wikia.com/wiki/CSV
http://vim.wikia.com/wiki/Highlight_multiple_words

See '...' in the first tip, and s:Highlight(args) in the second.

John


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



Re: [vim script] How to define a function with optional arguments?

2009-03-31 Thread Tim Chase

> Some built-in vim functions support optional arguments. For example,
> we can write winnr() as well as winnr('$'). Can I define my own
> functions with optional arguments? I found no hints in vim's online
> help.

The relevant help is at

   :help a:0

(it's another of those "it's easy to find if you already know 
what you're looking for" sorts of help bits :)

You can have up to 20 arguments by putting "..." in your function 
specification's parameters, and then referencing it with "a:1", 
"a:2", etc.  Or, you can access them as a list using "a:000". 
The number of arguments passed is contained in "a:0".

-tim





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



[vim script] How to define a function with optional arguments?

2009-03-31 Thread Clark J. Wang

Some built-in vim functions support optional arguments. For example,
we can write winnr() as well as winnr('$'). Can I define my own
functions with optional arguments? I found no hints in vim's online
help.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Regex substitute only outside "strings"

2009-03-31 Thread ivan budiselic
On Tue, Mar 31, 2009 at 10:13 AM, Andreas Bernauer wrote:

>
> ivan budiselic wrote:
> >>> So, for the line:
> >>>
> >>> 1234 a a "a" a
> >>>
> >>> I'd like to get:
> >>>
> >>> 1234 b b "a" b
> >>>
> >>> The question is, is this possible and how.
> >>>
> >>> What I've tried is
> >>> let line = substitute(line, '\([^\"]\{-}\)a', "\\1b", "g")
> >>
> >> ...because \{-} matches also 0 times; what you wanted is \{-1,}:
> >>
> >> let line = substitute('123 a "a" a', '\([^"]\{-1,}\)a', '\1b', 'g')
> >>
> >
> > Ok, this worked pretty well, except that it doesn't work for cases when
> > there's an 'a' at the start of the line (which I might be able to fix),
> and
>
> Allow matching 'start-of-line' (^) in front of 'a', too; see below.
>
> > the other problem which I wasn't specific enough about, and that is that
> I'd
> > like the change to happen to 'a's outside of strings, so for example
> > "xxxaxxx" shouldn't match. I guess this changes things quite a bit, sorry
> > for not being clear enough.
>
> So, would you like further help? If yes, could you provide an example for
> what
> you want to achieve?
>
> s/\(^\|\s\)\zsa\ze\s\?/b/
> works for
> a 123 a a "axxx" a
> ==>
> b 123 b b "axxx" b
>

Ok, so a complete example would be this:

a 123 a "xy a xax xa a" xa ax xax "a" " a " " xa ax xax " a

should result in

b 123 b "xy a xax xa a" xb bx xbx "a" " a " " xa ax axa " b

In words, all occurrences of 'a' outside of double quotes change to b, and
all occurrences of 'a' inside double qoutes stay uncanged.

The line you suggested doesn't handle the quotes. What I tried now is:

let line = substitute(line, '^\%([^"]\|.\{-}".\{-}".\{-}\)\{-}\zsa\ze', 'b',
'g')

Now, the problem I'm having is that I'm obviously missunderstanding the 'g'
flag. This line does what I want, but only does the substitution for the
first 'a' (so I can solve the problem by running it multiple times, until a
match is possible, which is what I thought the 'g' flag is supposed to do).

The idea behind the expressions is that the match should happen if there is
an even (possibly zero) number of double-quote characters to the left of an
'a' (and, again, it seems to be working, but only on the first match).

I'm sorry if I'm bothering you with this problem, your help is greatly
appreciated.

Ivan

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



Re: The list policy, AGAIN

2009-03-31 Thread derek

> On Mar 30, 5:28 pm, "John Beckett"  wrote:
>> Please clarify: Given these choices, what do you favour:
>>
>> 1. I post TO THE LIST a couple of times a week (could be more,
>> but no more than once a day) in reply to some top-poster, along
>> the lines that I have done in the past.
>
> I like this option. I will also occasionally respond directly to
> authors if I don't see a "hi, I'm the list moderator and you're doing
> it wrong" post on the list from you already.
>
>> 2. I post TO THE LIST once a week a standard "Mailing list
>> guidelines" message (not in reply to anyone).
>>
>
> I really don't think this will have much (if any) effect. I am pretty
> sure most of the offenders do not regularly read the list, or they
> would already be following our guidelines. If they are reading
> regularly, and just don't care about or disagree with our guidelines,
> referring to them will make no difference.
>
>> 3. I do not post any "do it our way" messages.
>>
>
> I don't like this option. As pointed out in that "how to ask questions
> on the internet" link somebody posted a while back (I'm too lazy at
> the moment to search for it), there are usually 2 kinds of lists:
> lists that go out of their way to be polite, and informative/helpful
> lists. Pick one.
>
>> Note that option 4 (I post direct to user and not to list) is
>> not going to happen. Of course someone else might like to
>> volunteer for that role.

I think this is my cue to leave :)

This topic has been more heavily posted on than anything else by far; it's
weaved its way into other topics as well and it has zip to do with Vim
(posting off topic being far worse than the format of the message IMHO). 
Not only that... this is just my opinion but I think you might need to
relax about this stuff - just let people post text and be done with it -
the human brain can handle top/bottom/middle posting without too much
trouble. :)

I joined this list to learn some sexy Vim bits and pieces after using it
for 10+ years (Vi for another 5).  I got a couple of neat bits of
information, but that's just a couple of drops in a sea of emails - I
posted a couple of times to try and be helpful and got personal emails in
response telling me that I wasn't posting with a "nice format" - ugh, it's
like living in a gated community where someone comes by to tell you that
your red tulips aren't allowed, but yellow ones would be OK.

The hottest topic of conversation is how a post should be formatted,
meaning that I could be harassed regularly if I don't post the way people
like.  That's just silly :)

I might follow things on the archive if the subjects are clear enough but
as for staying as a member of the list... just can't be done.

Cheers folks,
Derek



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



How to customize comment style?

2009-03-31 Thread loudking

Hello all,

My manager prefers comments in C files in this style

/*
**
**
*/

while the defalt comment style is

/*
 *
 *
 */

Could anybody tell me how to change that in VIM?

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



Re: Regex substitute only outside "strings"

2009-03-31 Thread Andreas Bernauer

ivan budiselic wrote:
>>> So, for the line:
>>>
>>> 1234 a a "a" a
>>>
>>> I'd like to get:
>>>
>>> 1234 b b "a" b
>>>
>>> The question is, is this possible and how.
>>>
>>> What I've tried is
>>> let line = substitute(line, '\([^\"]\{-}\)a', "\\1b", "g")
>>
>> ...because \{-} matches also 0 times; what you wanted is \{-1,}:
>>
>> let line = substitute('123 a "a" a', '\([^"]\{-1,}\)a', '\1b', 'g')
>>
> 
> Ok, this worked pretty well, except that it doesn't work for cases when
> there's an 'a' at the start of the line (which I might be able to fix), and

Allow matching 'start-of-line' (^) in front of 'a', too; see below.

> the other problem which I wasn't specific enough about, and that is that I'd
> like the change to happen to 'a's outside of strings, so for example
> "xxxaxxx" shouldn't match. I guess this changes things quite a bit, sorry
> for not being clear enough.

So, would you like further help? If yes, could you provide an example for what
you want to achieve?

s/\(^\|\s\)\zsa\ze\s\?/b/
works for
a 123 a a "axxx" a
==>
b 123 b b "axxx" b

-- 
Andreas.

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



RE: The list policy, AGAIN

2009-03-31 Thread John Beckett

Raúl Núñez de wrote:
>> 1. I post TO THE LIST a couple of times a week (could be
>> more, but no more than once a day) in reply to some
>> top-poster, along the lines that I have done in the past.
>
> I think this is the most effective, and I can help with that.
> In fact, *any* list member can help with that...

Yes thanks -- I hereby release into the public domain my posts
on bottom posting for copying and/or modification!

John


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



Re: The list policy, AGAIN

2009-03-31 Thread Raúl Núñez de Arenas Coronado

Saluton John :)

On Tue 31 Mar 2009 00:28 +0200, John Beckett  dixit:
> Please clarify: Given these choices, what do you favour:
>
> 1. I post TO THE LIST a couple of times a week (could be more, but no
> more than once a day) in reply to some top-poster, along the lines
> that I have done in the past.

I think this is the most effective, and I can help with that. In fact,
*any* list member can help with that...

> 2. I post TO THE LIST once a week a standard "Mailing list
> guidelines" message (not in reply to anyone).

Good idea, maybe, but people (specially topposters) will happily ignore
the message. The "1" option is much better because people usually get
the message when directly addressed to them ;)

-- 
Raúl "DervishD" Núñez de Arenas Coronado
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

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