unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: iluvindo <iluvindo@gmail.com>
Cc: Help-gnu-emacs@gnu.org
Subject: Re: vim equivalent in emacs %5,50s/serah_term/replace_term/gc
Date: Thu, 8 Nov 2007 11:48:53 +0100	[thread overview]
Message-ID: <87C0AE5D-BFAF-4026-AB39-FDD0D82ECC17@Web.DE> (raw)
In-Reply-To: <13640969.post@talk.nabble.com>


Am 08.11.2007 um 05:01 schrieb iluvindo:

> Hi I recently moved from vim to emacs and need help to search and  
> replace
> using line numbers(say between two lines 5 and 50).  This can be  
> done in vim
> as %5,50s/serah_term/replace_term/gc
> What is equivalent in emacs?

Activate 'active region highlighting' from Options menu, mark the  
region either by dragging with the mouse cursor or with the keyboard  
(M-g g 5 RET C-SPC M-g g 50 RET), and then substitute:

	M-x replace-string RET <from> RET <to> RET

The number of replacements in one line cannot be limited to one.  
Details can be found in the GNU Emacs tutorial (C-h t) or when asking  
for a description of the function:

	C-h f <function name> RET

There is also a hypertext based documentation:

	C-h i RET m emacs RET

There is also the function replace-regexp which uses regular  
expressions to search for a string and replace it with another one.

--
Greetings

   Pete

Make it simple, as simple as possible but no simpler.
                               Albert Einstein

  reply	other threads:[~2007-11-08 10:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  4:01 vim equivalent in emacs %5,50s/serah_term/replace_term/gc iluvindo
2007-11-08 10:48 ` Peter Dyballa [this message]
     [not found] ` <mailman.3124.1194518944.18990.help-gnu-emacs@gnu.org>
2007-11-23  2:33   ` David Combs
2007-11-23  2:43     ` Giorgos Keramidas
2007-12-16 19:40       ` David Combs
2007-12-16 23:08         ` Peter Dyballa
2007-11-23 10:15     ` Peter Dyballa
     [not found]     ` <mailman.3967.1195812952.18990.help-gnu-emacs@gnu.org>
2007-12-16 19:42       ` David Combs
     [not found] <mailman.3119.1194512077.18990.help-gnu-emacs@gnu.org>
2007-11-09 10:18 ` Rupert Swarbrick
2007-11-09 22:53   ` Lennart Borgman (gmail)

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=87C0AE5D-BFAF-4026-AB39-FDD0D82ECC17@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=Help-gnu-emacs@gnu.org \
    --cc=iluvindo@gmail.com \
    /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).