Article View: comp.editors
Article #3121Re: Query-replace on VI
From: Mark Towfigh
Date: Fri, 06 May 1988 16:40
Date: Fri, 06 May 1988 16:40
46 lines
2562 bytes
2562 bytes
In article <52205@sun.uucp> limes@sun.UUCP (Greg Limes) writes:
>>>> Does anyone know if VI has the query-replace function?
>>
>>>2) :g/foo/s//BAR/gc ### works in ex-mode
>>
>Ken, look at the command more carefully. That trailing "c" tells vi to
>ask the user about each replacement. Sounds amazingly like how EMACS
>handles "query-replace".
>
>Yes, I would like to get more people using EMACS ... but not by claiming
>that VI lacks such an important feature.
The problem is not that vi doesn't have the feature, but how
difficult it is to remember the key sequence, and how slow it is to
key it in. Just the fact that people had to post a query about how
to do this function is an indication of the dearth of on-line help
in vi.
I use Jove, an Emacs-based editor. If I had not known how to do a
query-replace, I could have just searched for all commands with the
string "query" or "replace" in their names. Then I would be able to
get a 3 or 4-line description of the command.
And when it comes to executing the command, here is my key sequence
(the spaces don't count):
ESC-q search-string RET replace-string RET
and then after that, I have a myriad of options on each replace,
including "replace all subsequent occurences without asking", "pause
here and let me edit the string", "stop", etc.
If you add it up, you see that vi takes *6* more keys to execute the
same command, plus the command keys are less accessible (ESC and RET
for EMACS vs. "/" and ":" for vi). And don't get me started on the
confusion between "ex-mode" and "insert-mode" in vi.
There's nothing in the promotion of EMACS for me; it's just that I
hate to see people waste time and get frustrated.
Mark Towfigh
--
Mark Towfigh If there's one thing I like better than a bologna
and whipped cream sandwich, it's honey and ketchup.
=======================================================================
UUCP/Inet: towfigh@phoenix.princeton.edu BITNET: TOWFIGH@PUCC
Technical Details
Message-ID:
<2801@phoenix.Princeton.EDU>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!udel!princeton!phoenix!towfighReferences:
<2587@geac.UUCP> <27909@yale-celray.yale.UUCP> <86@skep2.ATT.COM> <393@aiva.ed.ac.uk> <52205@sun.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!udel!princeton!phoenix!towfigh From: towfigh@phoenix.Princeton.EDU (Mark Towfigh) Newsgroups: comp.editors Subject: Re: Query-replace on VI Message-ID: <2801@phoenix.Princeton.EDU> Date: 6 May 88 16:40:17 GMT References: <2587@geac.UUCP> <27909@yale-celray.yale.UUCP> <86@skep2.ATT.COM> <393@aiva.ed.ac.uk> <52205@sun.uucp> Reply-To: towfigh@phoenix.Princeton.EDU (Mark Towfigh) Organization: Princeton University, NJ Lines: 46 Keywords: EMACS JOVE vi