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

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

Re: efficient replacing – really faster compared to using the mouse?


From: Filipp Gunbin
Subject: Re: efficient replacing – really faster compared to using the mouse?
Date: Fri, 10 Aug 2012 20:00:47 +0400

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 via email to

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