From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs equivalent of the ":g" command in vi
Date: Fri, 22 Jul 2011 11:48:52 +0200 [thread overview]
Message-ID: <8762mufxx7.fsf@gmail.com> (raw)
In-Reply-To: 14F21CEC-7265-4DE4-888A-A10FCFFF6826@Web.DE
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
> Am 22.07.2011 um 10:42 schrieb C K Kashyap:
>
>> I need to perform a certain action (such as delete the line) on each line of
>> a buffer if the line matches a regular expression. In vim, we can use the :g
>> command for this.
>
> I don't know that :g in vim that exactly, I prefer to use ``.´´ from time to time.
>
> GNU Emacs allows to use three commands:
>
> repeat
> repeat-complex-command
> repeat-matching-complex-command
>
> See which one can be used! (Deleting a single line is simple: C-k,
> deleting a bunch of lines is also quite simple: C-u <number> C-k –
> which could be as simple as in vi/vim.)
I think he want to delete lines matching a regexp, so C-k is not what he
wants here.
`query-replace-regexp' can be used with a regexp like this:
^.*\(your_regexp\).*$
and you replace with nothing (empty prompt).
--
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
next prev parent reply other threads:[~2011-07-22 9:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 8:42 Emacs equivalent of the ":g" command in vi C K Kashyap
2011-07-22 9:27 ` Peter Dyballa
2011-07-22 9:48 ` Thierry Volpiatto [this message]
2011-07-22 10:02 ` C K Kashyap
2011-07-22 10:12 ` Peter Dyballa
2011-07-22 10:41 ` C K Kashyap
2011-07-22 10:34 ` Thien-Thi Nguyen
2011-07-22 10:44 ` C K Kashyap
2011-07-22 10:45 ` Deniz Dogan
2011-07-22 10:46 ` Deniz Dogan
2011-07-22 19:03 ` Eric Abrahamsen
2011-07-22 20:27 ` MBR
2011-07-22 20:37 ` Andreas Röhler
2011-07-22 20:51 ` MBR
2011-07-23 7:10 ` Andreas Röhler
2011-08-15 0:27 ` Ken Goldman
2011-07-23 3:02 ` C K Kashyap
2011-07-23 8:44 ` suvayu ali
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8762mufxx7.fsf@gmail.com \
--to=thierry.volpiatto@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).