Wednesday, September 2, 2009

Re: Remove everything up to and including a certain word

On 25/08/09 12:57, Bastiaan Wakkie wrote:
> If I am standing (not in insert mode) with my cursor on the beginning .
> i would just type:ct1Hello World

E492: Not an editor command: ct1Hello

IOW, :ct1Hello is not a valid ex-command

Without the colon, it would mean: remove everything on the same line
until but not including the first digit-one on the right of the cursor,
then replace what was removed with "Hello World" (with capitals, and
without quotes). Not at all what the OP wanted, namely, delete from the
top of the file up to and including the first occurrence of "hello
world" (in lowercase, or in any case if 'ignorecase' is set; and still
without quotes) anywhere in the file, not necessarily on the same line.


Also, please bottom-post next time.

Regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
119. You are reading a book and look for the scroll bar to get to
the next page.


>
> drlatex wrote:
>> Hello there vimmers,
>>
>> I was wondering if I could remove everything in a file up to AND including a
>> certain word within the file.
>>
>> Let's say I have something like ""
>>
>> And I want only 123 to remain.
>>
>> Is there a way to delete everything up to and including the string "hello
>> word" ??
>>
>> I know that this particular string only comes up once in the file.
>>
>> Thanks in advance!
>>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments:

Post a Comment