help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: some vi equivalents please?


From: Teemu Likonen
Subject: Re: some vi equivalents please?
Date: Fri, 31 Oct 2008 15:53:20 GMT
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

rustom (2008-10-31 08:08 -0700) wrote:

> 1. In vi I can delete a line that contains a <pat> with
> :g/<pat>/d
>
> How is this done in emacs?

M-x flush-lines <RET> REGEXP <RET>

See
    (info "(emacs) Other Repeating Search")
or
    C-h f flush-lines RET

> 2. match-variables:
> If I want to remove everything after the second : (in a file that has
> 3 fields separated with two :'s)
> I do
> :s/\(.*\):\(.*\):.*/\1 \2
> How do I do that in emacs?

M-x replace-regexp <RET> \(.*\):\(.*\):.* <RET> \1 \2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]