[sf-lug] vi/vim/emacs/ed/ex/... oh my! ;-)

Michael Paoli Michael.Paoli at cal.berkeley.edu
Thu Jul 21 16:06:39 PDT 2016


Hmmmm, I dunno, ... I find ed(1) much simpler.  :-)
I mean I'd exit it with, e.g.:
w
q
None 'o those fancy schmancy control characters needed ... other
than newline and/or carriage return characters, as typically
generated by one's <Return> or <Enter> key, or <Control-M> or
<Control-J> if one wishes or needs.
ed(1) is also even yet smaller than nvi(1),
and ed(1) will often fit quite nicely on one's very
minimal bootable media (e.g. a floppy, or bit of tape loaded to RAM),
and don't even generally need to worry to much on
setting one's TERM, and oh, yes, also works quite
nicely on a hardcopy terminal.

And yes, still do use ed(1) for edit-in-place
scripts ... though I'll often use ex(1) instead -
the latter being a bit more standard and predictable
in the details of its behavior and return/exit codes
(notably due to POSIX, etc.).  Of course there are
other means to scripted edit-in-place, but doing so
using sh(1) and ex(1) would be among the more portable
standards compliant means of doing so.  Not every Unix-like
system is gonna have emacs installed, nor perl nor python nor
GNU extensions to sed(1), but if it's standards compliant,
it'll have a conforming ex(1) and sh(1).

$ type ed nvi vim
ed is hashed (/bin/ed)
nvi is /usr/bin/nvi
vim is /usr/bin/vim
$ ls -Lnos /bin/ed /usr/bin/nvi /usr/bin/vim
   52 -rwxr-xr-x 1 0   51424 Feb 25  2014 /bin/ed
  424 -rwxr-xr-x 3 0  428432 Mar  1  2014 /usr/bin/nvi
2196 -rwxr-xr-x 1 0 2240936 Mar 31  2015 /usr/bin/vim
$
Can we say order(s) of magnitude?

Exercise for the readers:
Which is bigger, vi(1), or ex(1)?
Hint: It may be a trick question.
Extra credit: full answer as to the why and how behind the answer.

> From: aaronco36 <aaronco36 at linuxwaves.com>
> Subject: Re: [sf-lug] written likely using vi/vim
> Date: Thu, 21 Jul 2016 14:36:28 -0700

> Quoting jim (jim at well.com) [1]:
>> i
>>
>> The sf-lug web site is now different, possibly better:
>> http://www.sf-lug.org/
>>
>> :wq
>
>
> Quoting Rick Moen (rick at linuxmafia.com) [2]:
>> Some accounts mention two specific words.  ;->
>
>
> And many of us no doubt realize that there are
> *another* notable "two specific <things>" used to
> write and then exit a file.
> That would be the consecutive keypair
> combinations of ctrl-x followed by ctrl-c (and
> then 'y') used by a certain famous Linux
> commandline editor that continues to heavily
> compete with vi and its variants [3]  ;-)
>
>
> [1]http://linuxmafia.com/pipermail/sf-lug/2016q3/012029.html
> [2]http://linuxmafia.com/pipermail/sf-lug/2016q3/012041.html
> [3]https://opensource.com/life/16/7/vim-or-emacs-which-text-editor-do-you-prefer





More information about the sf-lug mailing list