vim question
Toby Corkindale
tjc at wintrmute.net
Wed Mar 26 01:11:32 GMT 2008
On Wed, Mar 26 Cristina Nunes top-posted:
> Try V to select the all line and %s/:/ /
> and a g for every occurence too
Unfortunately the OP was interested in only changing the occurences after his
cursor position, whereas selecting the whole line will change all.
My own solution so far is quite inelegant:
i<cr><esc>:s/:/ /g<cr>kJx
> On Wed, Mar 26, 2008 at 12:12 AM, <asmith9983 at gmail.com> wrote:
> > I have the following file contents which I'm editing with vim:-
> >
> > 1 The quick brown fox jumped over the lazy dog.
> > 2 The:quick:brown:fox:jumped:over:the:lazy:dog.
> > 3 The quick brown fox jumped over the lazy dog.
> > 4 The quick brown fox jumped over the lazy dog.
> > 5 The quick brown fox jumped over the lazy dog.
> >
> >
> > I want to place my cursor on the b of brown on line 2, and with a simple
> > command change all the colons(:) to end of line, to a space( ). Obviously its
> > a change to end
> > of line only, so a g substitute modifier is no good. I've also tried selecting
> > selecting to end of line with v, visual mode, then applying ! operator with
> > sed -e 's/:/ /', but it didn't work.
> >
> > Anybody got an idea that'll work.
More information about the london.pm
mailing list