Thursday, September 16, 2010

Re: How to delete lines that begins...

Christian Brabandt wrote:
> Hi Krzysztof!
>
> On Do, 16 Sep 2010, Krzysztof Walkiewicz wrote:
>
>
>> 1) how to delete lines that begins by a digit?
>> 2) how to delete lines that begins by a '<' sign?
>>
> You can do both together:
> :g/^\(\d\|<\)/d
>

* delete lines beginning with a digit:
:g/^\d/d

* delete l ines beginning with a '<':
:g/^</d

* alternate solution for doing both:
:g/^[0-9^]d

See

:help :g
:help /^
:help /\d
:help /[

Regards,
Chip Campbell

--
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

No comments:

Post a Comment