unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Filipp Gunbin <fgunbin@fastmail.fm>
To: Ferdinand <Ferdinand.Gruebler@gmx.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: efficient replacing – really faster compared to using the mouse?
Date: Fri, 10 Aug 2012 20:00:47 +0400	[thread overview]
Message-ID: <86a9y2ohxs.fsf@w2139spb.ru.yotateam.com> (raw)
In-Reply-To: <BC05F0F5-29D0-423F-835F-19B393B36377@gmx.de> (message from Ferdinand on Fri, 10 Aug 2012 17:21:48 +0200)

Ferdinand <Ferdinand.Gruebler@gmx.de> writes:

> In emacs I just have no idea how to do this in a reasonable amount of time.
> Only to navigate to the next block with C-n / C-p and to get to the
> right place in the line with C-b / C-f takes a lot of time.

You could use incremental search (C-s and C-r) to jump faster, but this
still would be inefficient, of course.

> So what am I doing wrong here?
> How do you solve such edits in emacs efficiently?

You can do M-x query-replace-regexp (bound to C-M-%).

Type in the regexp when asked: "xyz[[:digit:]]+" (without quotes) and
the replacement: "xyz1".

Then continuously press <SPC> until you get to another section. At this
time press "e", edit the replacement string to xyz2 and begin pressing
<SPC> again.

Refer to "(emacs) Query Replace" info node for more information.

You could also record a macros which is a very natural way in Emacs to
perform complex repetitive editing. Read more about that in the manual.

Editing via a keyboard only is really faster!

-- 
Filipp Gunbin



  reply	other threads:[~2012-08-10 16:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 15:21 efficient replacing – really faster compared to using the mouse? Ferdinand
2012-08-10 16:00 ` Filipp Gunbin [this message]
2012-08-10 16:46 ` Peter Dyballa
2012-08-10 18:14 ` Aurélien Aptel
     [not found] <mailman.6706.1344612116.855.help-gnu-emacs@gnu.org>
2012-08-10 15:40 ` Carson Chittom
2012-08-10 16:46 ` Raffaele Ricciardi
2012-08-10 16:47 ` Ralf Fassel
2012-08-10 18:44 ` B. T. Raven
2012-08-11  3:50 ` rusi
2012-08-11 11:55   ` Ferdinand
2012-08-11 13:13     ` Filipp Gunbin
2012-08-12  2:49       ` Eric Abrahamsen

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=86a9y2ohxs.fsf@w2139spb.ru.yotateam.com \
    --to=fgunbin@fastmail.fm \
    --cc=Ferdinand.Gruebler@gmx.de \
    --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).