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: Peter Dyballa
Subject: Re: vim equivalent in emacs %5,50s/serah_term/replace_term/gc
Date: Thu, 8 Nov 2007 11:48:53 +0100


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

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