On Mon, Aug 24, 2009 at 7:06 PM, Gary Johnson <garyjohn@spocom.com> wrote:
:%s/\_.*hello word//
On 2009-08-24, 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 ".......hello word123"
>
> 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.
See
:help /\_.
Gary takes the prize. However, if you're "interactive" and you happen to be on the spot you want to delete from, you could also do this:
d/hello word\zs
Regs,
Derek
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment