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

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

Re: vim equivalent in emacs %5,50s/serah_term/replace_term/gc


From: Lennart Borgman (gmail)
Subject: Re: vim equivalent in emacs %5,50s/serah_term/replace_term/gc
Date: Fri, 09 Nov 2007 23:53:28 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

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?
Thanks,
Iluvindo

I don't know whether you can explicitly restrict the replace-string function, but the simplest way to do what you want is with narrow-to-
region.

From the doc string for replace-string in Emacs 22:

  In Transient Mark mode, if the mark is active, operate on the contents
  of the region.  Otherwise, operate from point to the end of the
  buffer.

So if region is visibly marked then the replace is only done in the region. (This is true if you use cua-mode for example.)






reply via email to

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