>true probably, have never been able to do a search replace in vi(le) yet in
>emacs I fly through everything...

*grin*

    :%s/[old string]/[new string]/g

is a global search & replace for all instances of a string within a file.

    :s/[old string]/[new string]/

only replaces the first occurrence on the current line, and:

    :.,+10s/[old string]/[new string]/

replaces the first occurrence in the current line, and also in the ten
which follow.


wasn't that easy?  ;-)


what you have to do is drop into 'ex' mode, which is the line-by-line
editing system that preceded vi.   the thing that makes vi such a pain to
learn is that it's very modal.. what a given key does depends heavily on
the key you pressed before it.   there /is/ a logic beneath it all, but it
takes a while to imprint it the cheat sheet on the inside of your skull.

(personally, i think the cut buffers rule, though.. 52 alternate buffers
for cutting & pasting.   being able to cut text into one buffer, without
having to clobber what you just copied from somewhere else, is addictive
once you get used to it)


emacs is a newer system, specifically designed as a screen editor, IIRC
(vi, by contrast, is the full-screen version of the line editor which ruled
in the days of teletypes).   emacs takes advantage of the 'bucky bits'
available on modern keyboards.. the <CTRL>, <SHIFT>, <ALT>, and <META> keys
which, taken together, offer sixteen possible shifting chords as extensions
for each key.   actually, i think emacs can distinguish between 'right
shift' and 'left shift', for a total of 8 bits of additional information
(256 different meanings) per key.

the challenge of emacs is to remember all the variant mappings each key can
have within such a rich environment of possibilities.   then there are the
multi-keystroke commands, which involve further learning still.   then
there's the built-in LISP interpreter, just in case you get bored after
mastering the previous learning curves.   then there's the universe of code
extensions that other emacs users have twiddled together and found useful
enough to share, which do everything from acting as a mail client to
serving as an alarm clock.



the standard jabs are:

    'vi'    : Virtually Impossible
    'emacs ': Eight Megs And Constantly Swapping


digs aside, though, both systems manage to do a hell of a lot with very
limited input hardware and display capability.. both were designed under
the old character-mapped model of screen display, as opposed to the
screen-mapped, multi-window model which rules the display world today.

technologically, they're both dinosaurs.   OTOH, they're both damn useful
when you have to telnet into a box through a slow modem connection and edit
a bunch of config files.   they're also just too good to throw away, and as
hardware technology advances, they both get leaner, meaner, and easier to
hang onto "just in case".   that's why i personally expect both of them to
last forever.


one of these days i want to see an SF movie, set in the 23d century, which
shows two characters /still/ engaged in the holy war between vi & emacs.
;-)






mike stone  <[EMAIL PROTECTED]>   'net geek..
been there, done that,  have network, will travel.



____________________________________________________________________
--------------------------------------------------------------------
 Join The NEW Web Consultants Association FORUMS and CHAT:
   Register Today at: http://just4u.com/forums/
Web Consultants Web Site : http://just4u.com/webconsultants
   Give the Gift of Life This Year...
     Just4U Stop Smoking Support forum - helping smokers for
      over three years-tell a friend: http://just4u.com/forums/
          To get 500 Banner Ads for FREE
    go to http://www.linkbuddies.com/start.go?id=111261
---------------------------------------------------------------------

Reply via email to