> -Original Message-
> From: vim_use@googlegroups.com On
> Behalf Of Tim Chase
> Sent: Tuesday, February 9, 2021 7:34 PM
> To: Kennedy, Marcus A.
> Cc: vim_use@googlegroups.com
> Subject: [EXTERNAL] Re: How to use search string in search replace?
>
> O
> -Original Message-
> From: vim_use@googlegroups.com On
> Behalf Of Salman Halim
> Sent: Tuesday, February 9, 2021 7:11 PM
> To: Vim Users
> Subject: [EXTERNAL] Re: How to use search string in search replace?
>
> If you specify no search string in the s c
On 2021-02-10 00:56, Kennedy, Marcus A. wrote:
> So I was searching through some ugly build commands when I realized
> that I needed to go from search mode to command mode to delete part
> of the output text I was looking at. Going from command mode with a
> :%s// to search mode will allow you to
If you specify no search string in the s command, it uses the last search
automatically:
%s//replacement...
--
Salman
On Tue, 9 Feb 2021, 19:56 Kennedy, Marcus A.,
wrote:
>
> So I was searching through some ugly build commands when I realized that
> I needed to go from search mode to command
So I was searching through some ugly build commands when I realized that
I needed to go from search mode to command mode to delete part of the
output text I was looking at. Going from command mode with a
:%s// to search mode will allow you to
press up arrow to get your last :%s/ search string, b
On 25/07/2018 05:20, tu...@posteo.de wrote:
Hi,
in a table made pure from ascii :) I want to
replace certain character for all lines but
in a certain column only.
Therefore I have to restrict search and replace
to a certain range of colums (vim context not table context).
How can I do that?
On Wed, Jul 25, 2018 at 5:20 AM, wrote:
> Hi,
>
> in a table made pure from ascii :) I want to
> replace certain character for all lines but
> in a certain column only.
>
> Therefore I have to restrict search and replace
> to a certain range of colums (vim context not table context).
>
> How can
Hi,
in a table made pure from ascii :) I want to
replace certain character for all lines but
in a certain column only.
Therefore I have to restrict search and replace
to a certain range of colums (vim context not table context).
How can I do that?
Thank you very much for any help in advance. :)
uot; which shoyld be replaced by "replace"
When finding replace it with
"Search" "Replace"
"SEARCH" "REPLACSE"
"search" "replace"
"SeArCh" "RePlAce"
and so on...
Is it pos
; Example:
> Given world is "search" which shoyld be replaced by "replace"
>
> When finding replace it with
> "Search" "Replace"
> "SEARCH" "REPLACSE"
> "search" "replace"
lace it with
"Search" "Replace"
"SEARCH" "REPLACSE"
"search" "replace"
"SeArCh" "RePlAce"
and so on...
Is it possible without any further interaction?
Thanks a lot in advance!
Cheers!
Meino
-
Thank you again John!
This was a long and laborious answer. Respect!
I will study your hints attentively later. But I think I will return to BBEdit,
if I have a global grep search & replace.
For the rest, I get accustomed more and more to the handy features of VIM.
Best greet
nserts the
value of the search register.
Before pressing Enter to execute the command, you have to edit it to insert the
capture. I suggest typing the command into a temporary buffer where you can
take your time to get it right. When finished you would have something like:
:%s/SEARCH/REPLACE/g
On Sunday, 1 April 2018 12:29:47 UTC+2, mstep@googlemail.com wrote:
Sorry I forgot to escape the capturing \( \)
So my search pattern should be:
:s/\begin{center}\n\(\s\+\)\textcolor{mygray}{\large
\([^}]\+\)}\s+\end{center}\s+/$1\vimcode{$2}/g
--
--
You received this message from the
On Monday, 2 April 2018 06:11:20 UTC+2, JohnBeckett wrote:
> On Sunday, April 1, 2018 at 8:29:47 PM UTC+10, mstep.germany wrote:
> > Search:
> >
> > \begin{center}
> > \textcolor{mygray}{\large w}
> > \end{center}
>
> To search for visually selected text, see http://vim.wikia.com/wiki/VimTip17
On Sunday, April 1, 2018 at 8:29:47 PM UTC+10, mstep.germany wrote:
> Search:
>
> \begin{center}
> \textcolor{mygray}{\large w}
> \end{center}
To search for visually selected text, see http://vim.wikia.com/wiki/VimTip171
I use the two vnoremap commands after "Search for selected text, forwards
Hello all!
I switched from Mac BBEdit to vim and need help with a grep pattern. I am still
a beginner and putting up a VIM cheat file in LATEX for all vim-commands, which
are part of my "repertoire". My search pattern is following, and there are many
of them in my file:
Search:
\begin{cent
cursor becomes an
> >>> empty rectangle, not blinking. And it is sometimes hard to find it in a
> >>> big page with many lines.
> >>>
> >>> Is it possible to make it blink in search/replace mode ?
> >>>
> >>> I tried without succe
.
But when I do "Edit" - "Search" or Edit" - "Replace", cursor becomes an empty
rectangle, not blinking. And it is sometimes hard to find it in a big page with many lines.
Is it possible to make it blink in search/replace mode ?
I tried without success th
dit" - "Search" or Edit" - "Replace", cursor becomes an
> > empty rectangle, not blinking. And it is sometimes hard to find it in a big
> > page with many lines.
> >
> > Is it possible to make it blink in search/replace mode ?
> >
&
r Edit" - "Replace", cursor becomes an empty
> rectangle, not blinking. And it is sometimes hard to find it in a big page
> with many lines.
>
> Is it possible to make it blink in search/replace mode ?
>
> I tried without success this command :
> set gcr=
it is sometimes hard to find it in a big page with
many lines.
Is it possible to make it blink in search/replace mode ?
I tried without success this command :
set gcr=a:block-Cursor-blinkwait175-blinkoff150-blinkon175
--
--
You received this message from the "vim_use" maillist.
Do
On Do, 17 Dez 2015, Melvin Simon wrote:
> Looks like \1 was the solution to extract pattern in .*
No, \1 can be used to extract the first pattern enclosed in \(\)
You can read the details here:
:h /\1
:h 12.2
Best,
Christian
--
Denken ist die schwerste Arbeit, die es gibt.
Das ist wahrscheinli
> > Date: Thu, 17 Dec 2015 22:52:47 -0800
> > From: wherei...@gmail.com
> > To: vim...@googlegroups.com
> > Subject: Search & replace
> >
> > Hi,
> >
> > I wanted to search & replace a particular pattern like below
> >
> > Repl
I think the following pattern shoud work
:%s/Figure of \(.*\) =/\0 \1/g
> Date: Thu, 17 Dec 2015 22:52:47 -0800
> From: whereismel...@gmail.com
> To: vim_use@googlegroups.com
> Subject: Search & replace
>
> Hi,
>
> I wanted to search & replace a particular
Hi,
I wanted to search & replace a particular pattern like below
Replace
Figure of xx =
Figure of yyy =
Figure of ghd =
Figure of yry =
with
Figure of xx = xx
Figure of yyy = yyy
Figure of ghd = ghd
Figure of yry = yry
I am looking at a command similar to below:-
:1,$ s/Figur
Thanks Folks.
Your suggestions have helped me, to understand new thing in vim about args.
For the reference of others, this is what I am settled with now.
Find pattern recursively: vimgrep
:vim /SEARCHTEXT/ *.c *.h
:vim /SEARCHTEXT/ **/*.c
Replace in multiple files: :argdo is there but I foun
On 30 May 2013, Asis Hallab wrote:
[...]
> There could be no better explanation for this than the one Drew Neil
> gives here:
> http://vimcasts.org/episodes/project-wide-find-and-replace/
>
> Take 6 and a half minutes of your time and enjoy his excellent
> screencast.
[...]
Screencasts #41-#
On Thursday, May 30, 2013 3:49:14 AM UTC-5, swapnil wrote:
> Hi All,
> I am gVim user on windows. I want suggestion from folks for
> search/replace recursively in multiple file use case. There are few tools
> like EasyGrep,Grep on windows. Searching in multiple files they
Dear Swapnil,
as with some things in Vim,
accomplishing this task with standard Vim functions seems at first
somewhat tricky.
But Vim actually has everything you need to do a project wide search
and replace.
Once you'll have understood how to accomplish this you'll see,
that actually can do many m
Hi All,
I am gVim user on windows. I want suggestion from folks for
search/replace recursively in multiple file use case. There are few tools like
EasyGrep,Grep on windows. Searching in multiple files they work, but I keep
facing issue for recursive search.
Can someone guide the best
Hi thinca!
On Fr, 02 Mär 2012, thinca wrote:
> Try this.
>
> %s@@\=system('cat /dev/urandom | strings | tr -d "\n" | head -c 15')@gc
Shorter:
%s@@\=system('head -c15 http://www.vim.org/maillist.php
Try this.
%s@@\=system('cat /dev/urandom | strings | tr -d "\n" | head -c 15')@gc
--
thinca
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
quite often, i want to write a test with a static file (html in this
instance). and i'd like to search and replace with random data. how do
i do this?
%s/thing/!cat /dev/urandom | strings | tr -d "\n" | head -c 15/gc
where 'cat /dev/urandom | strings | tr -d "\n" | head -c 15' is a unix
command (
Excerpts from Linda W's message of Wed Jan 18 01:17:00 +0100 2012:
> The other languages would HURT vim scripting -- in so much that MANY
> tasks can be done in a 'one-liner' (in vim as well, just very
> different)...that would be impossible in javascript, python or ruby.
> They are not concise
Gary Johnson wrote:
> How do you see a wiki page fitting into this? If I have to
> contact each of the authors individually anyway, wouldn't it
> be as easy or easier to include that information in the
> message to them?
Yes, that's fine (and thanks for undertaking to do it!).
I was thinking it
On 2012-01-18, John Beckett wrote:
> Gary Johnson wrote:
> > I was surprised at that figure, so I took a look myself.
> > I found 34 files in $VIMRUNTIME/syntax with that problem!
> >
> > I'd be willing to fix at least some of them except that
> > almost all of them are for languages that I never u
Gary Johnson wrote:
> I was surprised at that figure, so I took a look myself.
> I found 34 files in $VIMRUNTIME/syntax with that problem!
>
> I'd be willing to fix at least some of them except that
> almost all of them are for languages that I never use and
> know nothing about, so I don't think I
On 2012-01-17, Linda W wrote:
> I found a bug in the perl.vim file recently where the author didn't know the
> exact stuff I was complaining about being hard to learn -- all the RE
> exceptions.
>
> I knew the same bug was in Javascript syntax (.. I scanned the other vim
> files for the same patt
pite having enough
expertise to write syntax plugins.
That's the problem I'm talking about...But an editing macro language is
going to be a big unique -- it's doing a specialized function. That
doesn' mean it's
search & replace have to _*exclusive*_ be uniq...
Lind
On Fri, Dec 2, 2011 at 3:35 AM, Albin Olsson wrote:
>
> You should not lose the body tag because put will not replace anything.
> I'm guessing that you are on Linux, in that case the * register is the
> selection clipboard and and + is the copied text clipboard.
> So try
>
> :argdo g//put +
>
> i
On Dec 1, 11:49 pm, Rick R wrote:
>
> I'm still having trouble with this. I actually want it to replace the text
> in multiple files that aren't opened.
Then, the best way to do it, is using :argdo.
Start by opening a new window. The execute:
:arglocal (pattern or list of files to add)
(:args
On 12/01/11 23:49, Rick R wrote:
On Thu, Dec 1, 2011 at 11:20 PM, Tim Chase wrote:
If you have content in the clipboard you want to paste after each line,
you can do
:[whatever]do g/where_to_put_it/put=@*
I'm still having trouble with this. I actually want it to replace the text
in multip
On Fri, Dec 2, 2011 at 6:49 AM, Rick R wrote:
>
> Using what you suggested in vim I though maybe I could do something like:
>
> :args *.html
> :argdo g//put=@*
>
> But when try that (and I know in the above I'd lose the tag if it
> worked) all I get is highlighted in the file displayed.
You sho
On Thu, Dec 1, 2011 at 11:20 PM, Tim Chase wrote:
> On 12/01/11 22:11, Rick R wrote:
>
>> I often will find a multi line snippet of text that I'd like
>> to then replace in multiple files in my project after a
>> certain block of text (maybe it's some javascript for example
>> so I'll want the mu
On 12/01/11 22:11, Rick R wrote:
I often will find a multi line snippet of text that I'd like
to then replace in multiple files in my project after a
certain block of text (maybe it's some javascript for example
so I'll want the multiple lines pasted after the
initial
I want to try to force myself to use vim (MacVim) as my primary project
editor but this is holding me back...
I often will find a multi line snippet of text that I'd like to then
replace in multiple files in my project after a certain block of text
(maybe it's some javascript for example so I'll w
On Thu, Feb 3, 2011 at 10:19 AM, Benjamin R. Haskell wrote:
> On Wed, 2 Feb 2011, Colin Beighley wrote:
>
> Hello,
>> I want to do something like this
>>
>> word => ,
>>
>> becomes
>>
>> word => word,
>>
>> with search and replace. Any suggestions?
>>
>
> s/\(word\) => ,/\1 => \1,/
>
> --
> Best
On Wed, 2 Feb 2011, Colin Beighley wrote:
Hello,
I want to do something like this
word => ,
becomes
word => word,
with search and replace. Any suggestions?
s/\(word\) => ,/\1 => \1,/
--
Best,
Ben
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply b
On Wed, Feb 2, 2011 at 10:12 PM, Israel Chauca F.
wrote:
>
> On Feb 2, 2011, at 11:37 PM, Colin Beighley wrote:
>
> > Hello,
> >
> > I want to do something like this
> >
> > word => ,
> >
> > becomes
> >
> > word => word,
> >
>
> :%s/^word\ze => ,/& => &,/
>
> % => whole file
> ^ => Beginning
On Feb 2, 2011, at 11:37 PM, Colin Beighley wrote:
> Hello,
>
> I want to do something like this
>
> word => ,
>
> becomes
>
> word => word,
>
:%s/^word\ze => ,/& => &,/
% => whole file
^ => Beginning of line
\ze => end of text to be replaced
& => matched text
Replace 'word' with '\
Hello,
I want to do something like this
word => ,
becomes
word => word,
with search and replace. Any suggestions?
Thank,
Colin
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://ww
NEW USERS ON THIS MAILING LIST:
Please bottom post on this list. Quote a small (relevant) part
of the message you are replying to, and put your text underneath.
See
http://groups.google.com/group/vim_use/web/vim-information
--
You received this message from the "vim_use" maillist.
Do not top-po
Sweet, I'll check it out!
On May 9, 3:46 pm, Andy Wokula wrote:
> Am 09.05.2010 21:37, schrieb surge:
>
> > Hello all,
>
> > Let's say I'm in some column of some line in a file. When I do a
> > replace with ":s/something/something" and then do an ESC, the cursor
> > jumps to the beginning of the
Am 09.05.2010 21:37, schrieb surge:
Hello all,
Let's say I'm in some column of some line in a file. When I do a
replace with ":s/something/something" and then do an ESC, the cursor
jumps to the beginning of the line. Even if undo with an "u". Is there
a way for it to stay in the column before th
Hello all,
Let's say I'm in some column of some line in a file. When I do a
replace with ":s/something/something" and then do an ESC, the cursor
jumps to the beginning of the line. Even if undo with an "u". Is there
a way for it to stay in the column before the replace?
Thanks!
Sergius
--
You
Thank you all for the help :)
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
___
> Mike
> Gilbert
> Senior
> _____________
>
> After search & replace:
> __
> Mike Gilbert Senior
> _
>
> I hope you really got what I was asking.
>
You can also try gqat f
> > > replace the original text with \n character removed. There is a more
> > > complex example that I wanted to ask, here is the problem:
> > >
> > > Original
> > > __
> > > Mike
> &g
x example that I wanted to ask, here is the problem:
> >
> > Original
> > __
> > Mike
> > Gilbert
> > Senior
> > _
> >
> > After search & replace:
> > __
> Original
> __
> Mike
> Gilbert
> Senior
> _____________
>
> After search & replace:
> __
> Mike Gilbert Senior
> _
>
> I hope you really got what I was asking.
Try this:
:%s
;
> Original
> __
> Mike
> Gilbert
> Senior
> _____________
>
> After search & replace:
> __
> Mike Gilbert Senior
> _
>
>
> You can do this with:
: //, /<\/p>/ join
See help :
search & replace:
__
Mike Gilbert Senior
_
I hope you really got what I was asking.
TIA
On Thu, Apr 1, 2010 at 8:25 PM, Tim Chase wrote:
> Kunal Bajpai wrote:
>
>> I have been using Vim for about 3-4 months and am a student
On Thu, 1 Apr 2010, Kunal Bajpai wrote:
> I have been using Vim for about 3-4 months and am a student web
> developer. I am still learning Vim and need help with a command. I am
> editing some web pages using web pages many a times I have to edit web
> pages. Here is what I want:
>
>
Kunal Bajpai wrote:
I have been using Vim for about 3-4 months and am a student web
developer. I am still learning Vim and need help with a command.
I am editing some web pages using web pages many a times I have to
edit web pages. Here is what I want:
__
Mike
Gilbert
I have been using Vim for about 3-4 months and am a student web
developer. I am still learning Vim and need help with a command.
I am editing some web pages using web pages many a times I have to
edit web pages. Here is what I want:
__
Mike
Gilbert
Senior
__
Thank you very much.
On Feb 17, 5:29 pm, Andy Wokula wrote:
> Am 17.02.2010 16:21, schrieb eran:
>
> > Hi,
> > I want to be able to do a search and replace where (in one command) I
> > can replace e.g.
>
> > windows -> linux
> > Windows -> Linux
> > WINDOWS -> LINUX
>
> > Since the words might
Perfect! Thanks :)
On Feb 17, 5:29 pm, Andy Wokula wrote:
> Am 17.02.2010 16:21, schrieb eran:
>
> > Hi,
> > I want to be able to do a search and replace where (in one command) I
> > can replace e.g.
>
> > windows -> linux
> > Windows -> Linux
> > WINDOWS -> LINUX
>
> > Since the words might
Am 17.02.2010 16:21, schrieb eran:
Hi,
I want to be able to do a search and replace where (in one command) I
can replace e.g.
windows -> linux
Windows -> Linux
WINDOWS -> LINUX
Since the words might have different character counts we can't do a
1-1 mapping for the letter cases, but if we can
Hi,
I want to be able to do a search and replace where (in one command) I
can replace e.g.
windows -> linux
Windows -> Linux
WINDOWS -> LINUX
Since the words might have different character counts we can't do a
1-1 mapping for the letter cases, but if we can at least identify and
deal with the thr
On Mon, 23 Nov 2009 19:59:11 -0600
Tim Chase wrote:
>Vim's help is top-notch. Just about every facet you can think of
>is contained within. Finding it can be a bit more troublesome,
>especially if you know what you want, but don't know how Vim
>implements it. Using ":helpgrep" and tab/^D ex
>> (I've shifted to the "\...@!" which seems to work where the "\@> doesn't...kinda surprised me that didn't work).
>
> I didn't understand the subtle differences
>
>> :help /\@> :help /\...@!
I'm not really sure I completely understand the differences
myself...I generally use the "\@ but,
On Mon, 23 Nov 2009 08:47:43 -0600
Tim Chase wrote:
>
>> - there might be a succession of double bars (e.g. ||), in which
>> case X must not be inserted.
>
>I think this fails your last test about "||", but as this is
>a new detail, I claim leniency :)
>
>To meet your "||" test, it s
> - there might be a succession of double bars (e.g. ||), in which
> case X must not be inserted.
>
>> For #1, that would be something like either of these:
>>
>> s/||\_$\@
> works beautifully!
I think this fails your last test about "||", but as this is
a new detail, I claim lenienc
Thanks!
Tim Chase wrote on 23.11.09:
> country GB
> London
> Birmingham
> country GER
> Berlin
> Bonn
> -->
> GB London
> GB Birmingham
> GER Berlin
> GER Bonn
>
> It finds London, then copies the "country GB" line before it,
> deletes the word "country" and then joins "GB" and "London" to
> m
On Sun, 22 Nov 2009 18:35:49 -0600
Tim Chase wrote:
>> line ends and finishes with two bars:
>> || dfjdfjd || dfjdkfjsd || sds ||
>> -->
>> ||X dfjdfjd ||X dfjdkfjsd ||X sds ||
To be more precise, I know that
- line begins with ||
- line ends with
- there might be a succession of double bars (e
>> 1) bring the "country ___" line down to each non-country line:
>>
>>:v/^country /?country ?t-|s/country //|j
>> [...]
>> Step #1 is a bit packed:
>>
>>:v/ on every line that doesn't match
>>country the literal text "country "
>>/perform this set of acti
On Mon, 23 Nov 2009 10:48:29 +0100
Jan-Herbert Damm wrote:
>> 1) bring the "country ___" line down to each non-country line:
>>
>>:v/^country /?country ?t-|s/country //|j
>> [...]
>> ?country ? look backwards to the most recent
>> line containing "country "
>
>I th
Hello Tim and all,
Tim Chase wrote on 21.11.09:
> 1) bring the "country ___" line down to each non-country line:
>
>:v/^country /?country ?t-|s/country //|j
> [...]
> Step #1 is a bit packed:
>
>:v/ on every line that doesn't match
>country the literal text "country
> Gosh! The possibilities are endless.
Indeed, the power of global (":g" and ":v") commands along with
the substitute (":s") are two of the things that make vim my
favorite editor. Many hours of my time (and my coworkers' time)
have been saved by them.
> line ends and finishes with two bars:
On Sat, 21 Nov 2009 20:14:12 -0600
Tim Chase wrote:
>> Just to get me started on the more complex commands such as these:
>> where can I look up commands like :v and :g ?
>
>The :g and :v commands are documented as "sc" mentioned. The
>trick is knowing how to string them together with other Ex
> Thank you, Tim, for solution and explanation. This dioes exactly what I
> need.
>
>> Step #1 is a bit packed:
>>
>> :v/ on every line that doesn't match
>> [...]
>
> Just to get me started on the more complex commands such as these:
> where can I look up commands like :v and :g ?
T
On Saturday 21 November 2009 05:34:08 pm Tarlika Elisabeth
Schmitz wrote:
> Just to get me started on the more complex commands such as
> these: where can I look up commands like :v and :g ?
both are documented in repeat.txt, accessible via
:help :v
and
:help :g
sc
--~--~-~-
>> I have a csv file with the following content:
>>
>> country X
>> aa
>> bb
>> cc
>> dd
>> country Y
>> ee
>> ff
>>
>> which I would like to convert to
>>
>> X aa
>> X bb
>> X cc
>> X dd
>> Y ee
>> Y ff
>
>1) bring the "country ___" line down to each non-country line:
>
> :v/^country /?coun
> I have a csv file with the following content:
>
> country X
> aa
> bb
> cc
> dd
> country Y
> ee
> ff
>
> which I would like to convert to
>
> X aa
> X bb
> X cc
> X dd
> Y ee
> Y ff
>
> Can this be done with search and replace? I have got a search pattern
> but don't manage to churn out mu
Hello,
I have a csv file with the following content:
country X
aa
bb
cc
dd
country Y
ee
ff
which I would like to convert to
X aa
X bb
X cc
X dd
Y ee
Y ff
Can this be done with search and replace? I have got a search pattern
but don't manage to churn out multiple lines.
--
Best Regards,
T
> This cleared up the issue. But I can't understand why \r should mean
> one thing when searching, but something else when replacing. Is this a
> bug, or is there a reason for this that makes it worth complicating
> search/replace commands with inconsistent character mean
understand why \r
>> should mean one thing when searching, but something else when
>> replacing. Is this a bug, or is there a reason for this that
>> makes it worth complicating search/replace commands with
>> inconsistent character meanings?
>
> The text you quote fr
else when
> replacing. Is this a bug, or is there a reason for this that
> makes it worth complicating search/replace commands with
> inconsistent character meanings?
The text you quote from tip 26 is correct, and it's not a bug. There's a tiny
bit
more at
:help /\r
:hel
at makes it worth complicating
search/replace commands with inconsistent character meanings?
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---
> Is VIM capable of replacing matching text with a number that
> increments with each match?
>
> For instance:
>
> case %match:
> case %match:
> case %match:
> case %match:
>
> Becomes:
>
> case 1:
> case 2:
> case 3:
> case 4:
> case 5:
with a little bit of vim magic it can do most of that,
thebishop wrote:
> Is VIM capable of replacing matching text with a number that
> increments with each match?
>
> For instance:
>
> case %match:
> case %match:
> case %match:
> case %match:
>
> Becomes:
>
> case 1:
> case 2:
> case 3:
> case 4:
> case 5:
>
Several others have given a function+s
Sorry, typo. It has to be:
:let i=1
:g/case/s/%match/\=i/|let i+=1
xulxer wrote:
> Hi,
> On Tue, Oct 07, 2008 at 09:32:09AM -0700, thebishop wrote:
> >
> >Is VIM capable of replacing matching text with a number that
> >increments with each match?
> >
> >For instance:
> >
> >case %match:
> >case %
Hi,
On Tue, Oct 07, 2008 at 09:32:09AM -0700, thebishop wrote:
>
>Is VIM capable of replacing matching text with a number that
>increments with each match?
>
>For instance:
>
>case %match:
>case %match:
>case %match:
>case %match:
>
>Becomes:
>
>case 1:
>case 2:
>case 3:
>case 4:
>case 5:
>
yes v
Is VIM capable of replacing matching text with a number that
increments with each match?
For instance:
case %match:
case %match:
case %match:
case %match:
Becomes:
case 1:
case 2:
case 3:
case 4:
case 5:
--~--~-~--~~~---~--~~
You received this message from the
95 matches
Mail list logo