[londonperl] vim question
extasia at extasia.org
Wed Mar 26 01:19:59 GMT 2008
so you want to change colons to spaces only from 'b' to the end of the
line on line 2?
if this is the real task, and not a simple generalization of a larger
task, you could use ctrl-v to select the appropriate block and then
the s/// command would work within that block. note that when a
block is highlighted and you type ':' the following actually shows up
on the "command" line at the bottom of the editing session:
don't disturb that. put your s/// command right after it and it
should operate on the highlighted block.
if the real task(s) is(are) much more complicated, you could probably
use a programming language. i like perl.
On Tue, Mar 25, 2008 at 5:12 PM, <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.
Live in a world of your own, but always welcome visitors.
More information about the london.pm