On Thu, Jul 19, 2001 at 01:50:03PM +0100, Rory Winston mentioned:
> Hi,
>> Found a macro (written by VIm guru Benji FIsher) that does the below, but I
> cant seem to get it to work in my .vimrc. Do I need to use exec or normal to
> run this substitution? I want to put it in an exisiting function that is
> called whenever a certain filetype is written (C, Perl, Java, etc). BTW,
> I've just moved to Vim 6 (as of 10 minutes ago :-)) so if you have a version
> 6 -specific method, thats OK
>> Cheers
>> Rory
>> :
You want to add to your .vimrc;
au BufWrite *.txt s/\(version.*\)\(\d\{2,3}\)/\=submatch(1).(1+submatch(2))/
Only, I'm not sure what that regexp matches... what's \d ?
--
When I say 'free', I mean 'free': free from bond, of chain or command:
to go where you will, even to Mordor, Saruman, if you desire. "
-- Gandalf, paraphrasing the choice between Free and Non-free software
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!