RE: [EXTERNAL] Re: How to use search string in search replace?

2021-02-10 Thread Kennedy, Marcus A.
> -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

RE: [EXTERNAL] Re: How to use search string in search replace?

2021-02-10 Thread Kennedy, Marcus A.
> -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

Re: How to use search string in search replace?

2021-02-09 Thread Tim Chase
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

Re: How to use search string in search replace?

2021-02-09 Thread Salman Halim
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

How to use search string in search replace?

2021-02-09 Thread Kennedy, Marcus A.
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

Re: restricted search & replace

2018-07-24 Thread Lifepillar
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?

Re: restricted search & replace

2018-07-24 Thread Tony Mechelynck
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

restricted search & replace

2018-07-24 Thread tuxic
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. :)

Re: Is this case fitting search/replace possible?

2018-04-21 Thread David Woodfall
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

Re: Is this case fitting search/replace possible?

2018-04-21 Thread Ben Fritz
; Example: > Given world is "search" which shoyld be replaced by "replace" > > When finding replace it with > "Search" "Replace" > "SEARCH" "REPLACSE" > "search" "replace"

Is this case fitting search/replace possible?

2018-04-21 Thread tuxic
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 -

Re: Search & replace with grep

2018-04-03 Thread mstep.germany via vim_use
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

Re: Search & replace with grep

2018-04-02 Thread JohnBeckett
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

Re: Search & replace with grep

2018-04-02 Thread mstep.germany via vim_use
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

Re: Search & replace with grep

2018-04-02 Thread mstep.germany via vim_use
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

Re: Search & replace with grep

2018-04-01 Thread JohnBeckett
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

Search & replace with grep

2018-04-01 Thread mstep.germany via vim_use
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

Re: ***SPAM*** Re: blinking cursor in search/replace mode

2017-09-08 Thread LGentis
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

Re: ***SPAM*** Re: blinking cursor in search/replace mode

2017-09-06 Thread Lucien Gentis
. 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

Re: blinking cursor in search/replace mode

2017-09-05 Thread Bram Moolenaar
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 ? > > &

Re: blinking cursor in search/replace mode

2017-09-05 Thread LGentis
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=

blinking cursor in search/replace mode

2017-08-17 Thread LGentis
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

Re: Search & replace

2015-12-17 Thread Christian Brabandt
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

Re: Search & replace

2015-12-17 Thread Melvin Simon
> > 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

RE: Search & replace

2015-12-17 Thread TanParker
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

Search & replace

2015-12-17 Thread Melvin Simon
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

Re: Best possible plugin/tool for multiple files search/replace in gVim (windows)

2013-05-31 Thread swapnil kamble
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

Re: Best possible plugin/tool for multiple files search/replace in gVim (windows)

2013-05-30 Thread LCD 47
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-#

Re: Best possible plugin/tool for multiple files search/replace in gVim (windows)

2013-05-30 Thread Ben Fritz
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

Re: Best possible plugin/tool for multiple files search/replace in gVim (windows)

2013-05-30 Thread Asis Hallab
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

Best possible plugin/tool for multiple files search/replace in gVim (windows)

2013-05-30 Thread swapnil
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

Re: search replace function

2012-03-03 Thread Christian Brabandt
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

Re: search replace function

2012-03-01 Thread thinca
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

search replace function

2012-03-01 Thread shawn wilson
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 (

Re: Request for search/replace upgrade, not wholesale replacement!

2012-01-18 Thread Marc Weber
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

RE: Request for search/replace upgrade, not wholesale replacement!

2012-01-18 Thread John Beckett
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

Re: Request for search/replace upgrade, not wholesale replacement!

2012-01-18 Thread Gary Johnson
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

RE: Request for search/replace upgrade, not wholesale replacement!

2012-01-17 Thread John Beckett
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

Re: Request for search/replace upgrade, not wholesale replacement!

2012-01-17 Thread Gary Johnson
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

Re: Request for search/replace upgrade, not wholesale replacement!

2012-01-17 Thread Linda W
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

Re: If I copy multi line text to clipboard how do I know use that in vim for replace text in search/replace?

2011-12-02 Thread Rick R
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

Re: If I copy multi line text to clipboard how do I know use that in vim for replace text in search/replace?

2011-12-02 Thread Ben Fritz
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

Re: If I copy multi line text to clipboard how do I know use that in vim for replace text in search/replace?

2011-12-02 Thread Tim Chase
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

Re: If I copy multi line text to clipboard how do I know use that in vim for replace text in search/replace?

2011-12-02 Thread Albin Olsson
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

Re: If I copy multi line text to clipboard how do I know use that in vim for replace text in search/replace?

2011-12-01 Thread Rick R
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

Re: If I copy multi line text to clipboard how do I know use that in vim for replace text in search/replace?

2011-12-01 Thread Tim Chase
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

If I copy multi line text to clipboard how do I know use that in vim for replace text in search/replace?

2011-12-01 Thread Rick R
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

Re: Copying and inserting a word in a search/replace

2011-02-03 Thread Colin Beighley
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

Re: Copying and inserting a word in a search/replace

2011-02-03 Thread Benjamin R. Haskell
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

Re: Copying and inserting a word in a search/replace

2011-02-03 Thread Colin Beighley
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

Re: Copying and inserting a word in a search/replace

2011-02-02 Thread Israel Chauca F.
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 '\

Copying and inserting a word in a search/replace

2011-02-02 Thread Colin Beighley
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

RE: restore cursor position after search/replace

2010-05-10 Thread John Beckett
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

Re: restore cursor position after search/replace

2010-05-10 Thread surge
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

Re: restore cursor position after search/replace

2010-05-09 Thread Andy Wokula
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

restore cursor position after search/replace

2010-05-09 Thread 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 the replace? Thanks! Sergius -- You

Re: Search & Replace

2010-04-05 Thread Kunal Bajpai
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

Re: Search & Replace

2010-04-02 Thread Ben Fritz
___ > Mike > Gilbert >  Senior > _____________ > > After search & replace: > __ > Mike Gilbert Senior > _ > > I hope you really got what I was asking. > You can also try gqat f

Re: Search & Replace

2010-04-02 Thread Christian Brabandt
> > > 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

Re: Search & Replace

2010-04-02 Thread Benjamin R. Haskell
x example that I wanted to ask, here is the problem: > > > > Original > > __ > > Mike > > Gilbert > > Senior > > _ > > > > After search & replace: > > __

Re: Search & Replace

2010-04-02 Thread Christian Brabandt
> Original > __ > Mike > Gilbert > Senior > _____________ > > After search & replace: > __ > Mike Gilbert Senior > _ > > I hope you really got what I was asking. Try this: :%s

Re: Search & Replace

2010-04-02 Thread Karthick Gururaj
; > Original > __ > Mike > Gilbert > Senior > _____________ > > After search & replace: > __ > Mike Gilbert Senior > _ > > > You can do this with: : //, /<\/p>/ join See help :

Re: Search & Replace

2010-04-01 Thread Kunal Bajpai
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

Re: Search & Replace

2010-04-01 Thread Benjamin R. Haskell
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: > >

Re: Search & Replace

2010-04-01 Thread Tim Chase
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

Search & Replace

2010-04-01 Thread Kunal Bajpai
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 __

Re: search & replace where the new word matches the case of the replaced word

2010-02-17 Thread eran
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

Re: search & replace where the new word matches the case of the replaced word

2010-02-17 Thread eran
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

Re: search & replace where the new word matches the case of the replaced word

2010-02-17 Thread Andy Wokula
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

search & replace where the new word matches the case of the replaced word

2010-02-17 Thread 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 at least identify and deal with the thr

Re: search replace in repeat pattern

2009-11-24 Thread Tarlika Elisabeth Schmitz
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

Re: search replace in repeat pattern

2009-11-23 Thread Tim Chase
>> (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,

Re: search replace in repeat pattern

2009-11-23 Thread Tarlika Elisabeth Schmitz
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

Re: search replace in repeat pattern

2009-11-23 Thread Tim Chase
> - 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

Re: search replace in repeat pattern

2009-11-23 Thread Jan-Herbert Damm
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

Re: search replace in repeat pattern

2009-11-23 Thread Tarlika Elisabeth Schmitz
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

Re: search replace in repeat pattern

2009-11-23 Thread Tim Chase
>> 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

Re: search replace in repeat pattern

2009-11-23 Thread Tarlika Elisabeth Schmitz
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

Re: search replace in repeat pattern

2009-11-23 Thread Jan-Herbert Damm
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

Re: search replace in repeat pattern

2009-11-22 Thread Tim Chase
> 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:

Re: search replace in repeat pattern

2009-11-22 Thread Tarlika Elisabeth Schmitz
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

Re: search replace in repeat pattern

2009-11-21 Thread Tim Chase
> 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

Re: search replace in repeat pattern

2009-11-21 Thread sc
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 --~--~-~-

Re: search replace in repeat pattern

2009-11-21 Thread Tarlika Elisabeth Schmitz
>> 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

Re: search replace in repeat pattern

2009-11-21 Thread Tim Chase
> 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

search replace in repeat pattern

2009-11-21 Thread Tarlika Elisabeth Schmitz
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

Re: Search/Replace inconsistency

2008-10-21 Thread Ben Schmidt
> 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

Re: Search/Replace inconsistency

2008-10-20 Thread Tony Mechelynck
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

RE: Search/Replace inconsistency

2008-10-20 Thread John Beckett
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

Search/Replace inconsistency

2008-10-19 Thread bgold12
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 -~--~~~~--~~--~--~---

Re: Search/Replace with Numbered List ?

2008-10-07 Thread Tim Chase
> 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,

Re: Search/Replace with Numbered List ?

2008-10-07 Thread Charles Campbell
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

Re: Search/Replace with Numbered List ?

2008-10-07 Thread Xulxer
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 %

Re: Search/Replace with Numbered List ?

2008-10-07 Thread xulxer
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

Search/Replace with Numbered List ?

2008-10-07 Thread thebishop
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