News for hackers. Stuff that matters.
Re:A vi-centric family tree of editors (2000) by baby on Sunday November 27, 2016 @08:26PM (#13052788)
Anyone knows why emacs is almost never installed by default while vi(m) is? I often wish I had learned vim instead of emacs because of this :/
Re:A vi-centric family tree of editors (2000) by throw_away on Sunday November 27, 2016 @08:31PM (#13052811)
Historically, probably because

    $ ls -lh `which emacs`
    -r-xr-xr-x  1 root  wheel   220M Oct 19 02:10 /usr/bin/emacs
    $ ls -lh `which vim`
    -rwxr-xr-x  1 root  wheel   1.7M Oct 19 02:38 /usr/bin/vim
Disk space isn't as much of an issue anymore, but still, it's 100x the size.
Re:A vi-centric family tree of editors (2000) by bch on Sunday November 27, 2016 @09:05PM (#13052917)
To say nothing of:

        kamloops$ ldd  $(which vi)
        /usr/bin/vi:
                -lcurses.7 => /usr/lib/libcurses.so.7
                -lterminfo.1 => /usr/lib/libterminfo.so.1
                -lc.12 => /usr/lib/libc.so.12
                -lutil.7 => /usr/lib/libutil.so.7
        kamloops$ ls -ld  $(which vi)
        -r-xr-xr-x  3 root  wheel  506072 Nov 26 15:57 /usr/bin/vi
        kamloops$ ldd /usr/pkg/bin/emacs-24.5
        /usr/pkg/bin/emacs-24.5:
                -lossaudio.1 => /usr/lib/libossaudio.so.1
                -lc.12 => /usr/lib/libc.so.12
                -lexecinfo.0 => /usr/lib/libexecinfo.so.0
                -lelf.2 => /usr/lib/libelf.so.2
                -lterminfo.1 => /usr/lib/libterminfo.so.1
                -lpthread.1 => /usr/lib/libpthread.so.1
                -lm.0 => /usr/lib/libm.so.0
                -lz.1 => /usr/lib/libz.so.1
        kamloops$ ls -ld /usr/pkg/bin/emacs-24.5
        -rwxr-xr-t  1 root  wheel  14682824 Jul 27 16:51 /usr/pkg/bin/emacs-24.5
        #
        # count of files installed per package...
        #
        kamloops$ wc -l /usr/pkgsrc/editors/nvi/PLIST
              24 /usr/pkgsrc/editors/nvi/PLIST
        kamloops$ wc -l /usr/pkgsrc/editors/emacs24/PLIST
            3914 /usr/pkgsrc/editors/emacs24/PLIST
Re:A vi-centric family tree of editors (2000) by shermanyo on Sunday November 27, 2016 @09:59PM (#13053112)
I think this is the more relevant requirement, the above build even links to an audio library...
Re:A vi-centric family tree of editors (2000) by TorKlingberg on Monday November 28, 2016 @08:33AM (#13055254)
Of course, we can do even better these days

    $ ldd /opt/sublime_text/sublime_text | wc -l
    15
    $ ldd /home/tmk/.local/share/umake/ide/visual-studio-code/code | wc -l
    84
And I'm not sure ldd even captures all the libraries these things load.
Re:A vi-centric family tree of editors (2000) by JdeBP on Monday November 28, 2016 @11:05AM (#13056252)
Things are better still when one stops looking at shared libraries and starts looking at run-time remote procedure call dependencies.

The GNOME editor, a "small and lightweight text editor" according to the blurb and its reviews by some clearly incurious reviewers, requires that a per-user/per-login Desktop Bus broker be running and also (on my machine) that the following Desktop Bus servers be running: at-spi-bus-launcher (which runs another Desktop Bus broker), api-spi2-registryd, dconf-service, gvfsd, gvfsd-udisks2-volume-monitor, gvfsd-afc-volume-monitor, gvfsd-goa-volume-monitor, gvfsd-gphoto2-volume-monitor, and gvfsd-mtp-volume-monitor.

Normally, it behaves like WIN16 programs used to behave: invoking the editor a second time simply sends a D-BUS message to the already running first instance to tell it to open another document and then exits that second invocation. If you want to start up a true second separate instance, one way to do so is use dbus-run-session to start it up with a private Desktop Bus broker of its own. Of course, doing so starts up second instances of all of the aforementioned D-BUS servers as well.

This is not "small and lightweight".

* http://unix.stackexchange.com/a/323700/5132

* http://unix.stackexchange.com/questions/201900/

Re:A vi-centric family tree of editors (2000) by mhd on Monday November 28, 2016 @08:33AM (#13055251)
nvi vs. X11 emacs? Isn't that a bit like comparing uemacs to gvim?
Re:A vi-centric family tree of editors (2000) by bch on Monday November 28, 2016 @12:11PM (#13056774)
This isn't comparing X11 emacs to vi, it's emacs (built w/ a no-x11 switch) on NetBSD compared w/ native nvi. If this were an X11 enabled binary, you'd see links to various X11 libs and GUI toolkits, similar to this xterm:

        /usr/X11R7/bin/xterm:
                -lXft.3 => /usr/X11R7/lib/libXft.so.3
                -lX11.7 => /usr/X11R7/lib/libX11.so.7
                -lxcb.2 => /usr/X11R7/lib/libxcb.so.2
                -lXau.7 => /usr/X11R7/lib/libXau.so.7
                -lc.12 => /usr/lib/libc.so.12
                -lXdmcp.7 => /usr/X11R7/lib/libXdmcp.so.7
                -lfontconfig.2 => /usr/X11R7/lib/libfontconfig.so.2
                -lexpat.2 => /usr/lib/libexpat.so.2
                -lfreetype.18 => /usr/X11R7/lib/libfreetype.so.18
                -lz.1 => /usr/lib/libz.so.1
                -lbz2.1 => /usr/lib/libbz2.so.1
                -lXrandr.3 => /usr/X11R7/lib/libXrandr.so.3
                -lXrender.2 => /usr/X11R7/lib/libXrender.so.2
                -lXext.7 => /usr/X11R7/lib/libXext.so.7
                -lXaw7.10 => /usr/X11R7/lib/libXaw7.so.10
                -lXmu.7 => /usr/X11R7/lib/libXmu.so.7
                -lXt.7 => /usr/X11R7/lib/libXt.so.7
                -lSM.7 => /usr/X11R7/lib/libSM.so.7
                -lICE.7 => /usr/X11R7/lib/libICE.so.7
                -lXpm.5 => /usr/X11R7/lib/libXpm.so.5
                -lXinerama.2 => /usr/X11R7/lib/libXinerama.so.2
                -lcurses.7 => /usr/lib/libcurses.so.7
                -lterminfo.1 => /usr/lib/libterminfo.so.1
                -lutil.7 => /usr/lib/libutil.so.7
Re:A vi-centric family tree of editors (2000) by hueving on Sunday November 27, 2016 @08:37PM (#13052830)
It's still very much this. The footprints of many entire server distros are less than 220MB.
Re:A vi-centric family tree of editors (2000) by paul on Sunday November 27, 2016 @08:36PM (#13052828)
That's how I ended up learning vi. In 1993, my 386 didn't have enough disk space for emacs, so I had to learn vi (which is lucky because I probably wouldn't have done it otherwise).
Re:A vi-centric family tree of editors (2000) by wonnage on Sunday November 27, 2016 @09:12PM (#13052946)
"eight megs and constantly swapping" seems so quaint :P
Re:A vi-centric family tree of editors (2000) by 50CNT on Sunday November 27, 2016 @09:36PM (#13053020)
with emacs 25 incorporating webkit, we can now say "emacs may also contain safari"
Re:A vi-centric family tree of editors (2000) by rahoulb on Monday November 28, 2016 @07:41AM (#13055023)
Given that the browser is fast approaching a full OS layer, does that mean you're effectively running an OS within an OS within an OS (or more so if you're running on virtualisation)?
Re:A vi-centric family tree of editors (2000) by 50CNT on Monday November 28, 2016 @08:16AM (#13055179)
I don't know, but open up emacs, type M-x term, then emacs -nw, then type M-x term, then repeat.

It's very silly.

Re:A vi-centric family tree of editors (2000) by codemac on Sunday November 27, 2016 @10:15PM (#13053171)
Are these statically linked?

; ls -hl `{which emacs-25.1} -rwxr-xr-x 1 root root 17M Sep 18 04:32 /bin/emacs-25.1 ; ls -hl `{which vim} -rwxr-xr-x 1 root root 2.6M Nov 15 16:06 /bin/vim ;

17M is much more reasonable, but emacs has many supporting files as well. It's been installed on every system I've ever used that wasn't busybox-based, you can package it much smaller.

Re:A vi-centric family tree of editors (2000) by greglindahl on Sunday November 27, 2016 @09:35PM (#13053016)
In ancient times, emacs didn't have an X-Windows driver. On my current box, emacs-nox is 13 megabytes.
Re:A vi-centric family tree of editors (2000) by dotancohen on Monday November 28, 2016 @06:08AM (#13054703)
And to think that "Eight Megs And Counting" was once an exaggeration!
Re:A vi-centric family tree of editors (2000) by weaksauce on Monday November 28, 2016 @01:50PM (#13057490)
Also, typically the tiny version of vim is installed by default.
Re:A vi-centric family tree of editors (2000) by linksnapzz on Sunday November 27, 2016 @08:46PM (#13052861)
IIRC, it was the case that for commercial Unixen, the Single Unix Specification v.2 stated that amongst other things, the vi editor always had to be available.

So, vi gets dragged in as part of your vendor's commitment to "standards compliance". Also, for SUS purposes, vi means SysV vi, not vim. A far less domesticated creature.

In a base install of Solaris, Irix, HP-UX or Tru64, it'd be the only editor you get. Vim, emacs, nano, joe etc. would all be in a seperate "freeware tools" or somesuch sideloaded optional install set.

Re:A vi-centric family tree of editors (2000) by Spooky23 on Sunday November 27, 2016 @10:19PM (#13053184)
Not only that, but vendors would freeze those tools in time.

I worked for an employer who banned "freeware" tools so you were stuck with ancient, broken software on Solaris and other systems.

Post 9-11, we had to secure all of the things, including moving away from rsh and telnet. SSH was problematic due to the freeware thing -- no worry... we were able to buy "IBM SSH" for $900 per processor value unit. (IBM SSH was an out of date OpenSSH where someone did a find and replace substituting Open with IBM)

Re:A vi-centric family tree of editors (2000) by erelde on Monday November 28, 2016 @05:29AM (#13054566)
"Nobody ever got fired for buying IBM."

This entire thread makes me giggle, usually posts about editors are filled with bad temper, but not this one.

Re:A vi-centric family tree of editors (2000) by craigsmansion on Monday November 28, 2016 @07:59AM (#13055096)
> it'd be the only editor you get.

Slanderous and outrageous lies!

Ed, man! !man ed

Computer Scientists love ed, not just because it comes first alphabetically, but because it's the standard. Everyone else loves ed because it's ED!

“Ed is the standard text editor.”

But more historical and factual: Ed is actually "mandatory on systems conforming to the Single Unix Specification)" as well.

Re:A vi-centric family tree of editors (2000) by YeGoblynQueenne on Monday November 28, 2016 @09:49AM (#13055699)
Ah, ed. I have fond memories of being stuck in an ed command line inside the Unix mode of Z/OS on a mainframe.

  exit
  ?
  quit
  ?
  q
  ?
  bye
  ?
  help
  ?
  ohmygodgetmeouttaheeeeere
  ?
P.S. I'm not a native English speaker. "Fond" means "a vision of hell" right?
Re:A vi-centric family tree of editors (2000) by AimHere on Monday November 28, 2016 @11:23AM (#13056382)
Yes. Yes, that's exactly what it means.
Re:A vi-centric family tree of editors (2000) by macintux on Monday November 28, 2016 @08:23AM (#13055215)
I learned to program C in a crippled version of ed. Ed rocks!
Re:A vi-centric family tree of editors (2000) by codezero on Sunday November 27, 2016 @09:48PM (#13053061)
This is how I learned vi. I was a pico (now called nano) user but needed to edit the hosts file when Solaris was released for x86.
Re:A vi-centric family tree of editors (2000) by digi_owl on Wednesday November 30, 2016 @10:45AM (#13071614)
More correctly nano is a reimplementation of pico.

This, iirc, done because pico was part of the pine email client. And pine was covered by a iffy license.

Re:A vi-centric family tree of editors (2000) by codezero on Sunday December 04, 2016 @02:51PM (#13101451)
Ah, neat, I didn't realize it wasn't just renamed :)
Re:A vi-centric family tree of editors (2000) by notaplumber on Sunday November 27, 2016 @09:40PM (#13053031)
OpenBSD includes both mg(1), the emacs-like editor and nvi the 4.4BSD new vi(1).

http://man.openbsd.org/OpenBSD-current/man1/mg.1

http://man.openbsd.org/OpenBSD-current/man1/vi.1

Re:A vi-centric family tree of editors (2000) by 0xcde4c3db on Sunday November 27, 2016 @11:10PM (#13053356)
I think the historical reason for this is that vi (or rather, ex; the "vi" executable was added later) was part of BSD since the original BSD release. From there it got picked up by System V, and then since both BSD and System V had it, it was a shoo-in for the role of the standard POSIX visual editor.
Re:A vi-centric family tree of editors (2000) by DonaldFisk on Sunday November 27, 2016 @09:08PM (#13052929)
On Unix, the editors were ed and vi. EMACS originated on ITS and is part of GNU, so it should be installed by default on GNU/Linux but not necessarily on other Unices.
Re:A vi-centric family tree of editors (2000) by grigjd3 on Sunday November 27, 2016 @08:33PM (#13052813)
I still hear the old joke sometimes:

Emacs user: You should never turn off emacs.

Vim user: because it takes too long to load emacs.

The irony being the points behind both sides of this joke pretty much have no meaning with the current state of technology.

Re:A vi-centric family tree of editors (2000) by lukeschlather on Sunday November 27, 2016 @08:43PM (#13052850)
Not really. I'm an Emacs partisan, but my Emacs takes at least 3 seconds to load (often 4 or even a little more), while vim is instant.

It is faster than Google Docs or MS Office, but the lag is noticeable.

Re:A vi-centric family tree of editors (2000) by kazinator on Sunday November 27, 2016 @10:58PM (#13053310)
Vim is not instant. Moreover, it has annoying TTY handling behaviors; it flushes the TTY when starting.

So if I type

   $ vim file
and start entering editing commands, often I do it so fast that some of the characters get cut off, like the leading colon of an ex command or what have you.

There is no good reason for this. It will not happen with any reasonable command line utility.

I reported this to the Vim mailing list not long ago and was basically brushed off.

Re:A vi-centric family tree of editors (2000) by JdeBP on Monday November 28, 2016 @10:23AM (#13055940)
I read https://groups.google.com/d/msg/vim_use/XX6SoxHAzhI/vuyIx71G... and it doesn't look like a brush-off to me.

What's missing is the statement that this is how things work when one is relying upon terminals to respond to special control sequences with strings denoting their capabilities. In theory one could save up and re-process the input characters that arrive before the DECDSR response. In practice, people throw them away.

Did you try it on a non-xterm terminal type, as was suggested?

Re:A vi-centric family tree of editors (2000) by aktau on Monday November 28, 2016 @04:53AM (#13054435)
Have you reported it to the Neovim devs? It stands a better chance of being included there (IMHO) and from there it's possible that it trickles up (like the async features in Vim 8).
Re:A vi-centric family tree of editors (2000) by weaksauce on Monday November 28, 2016 @01:10AM (#13053724)
I love vim but recently started using Emacs with spacemacs and it takes a long time to load. Vim is basically instantaneous and Emacs is like molasses.
Re:A vi-centric family tree of editors (2000) by barrkel on Monday November 28, 2016 @04:46AM (#13054407)
(emacs-init-time) "0.2 seconds"

Use autoloads everywhere. Put all per-package configuration in lambdas executed on hooks, or eval-after-load. Lazy-load Helm by mapping M-x to helm-M-x etc. - small ad-hoc edits probably don't even need Helm.

I still use emacs --daemon / emacsclient (aliased to 'e'), but I keep my $EDITOR set to emacs. There's no good reason to have a long wait for startup.

Re:A vi-centric family tree of editors (2000) by grigjd3 on Sunday November 27, 2016 @09:00PM (#13052897)
Well I certainly don't dig into the depths of what I can make emacs do (and hence load) but I find it opens seemingly instantly for me unless I am doing something like using the window mode on a VM that mimics a video card.
Re:A vi-centric family tree of editors (2000) by aoeuhtns on Sunday November 27, 2016 @09:13PM (#13052949)
Re:A vi-centric family tree of editors (2000) by techdragon on Sunday November 27, 2016 @09:46PM (#13053056)
I should not need to run a background daemon for my text editor to load quickly.
Re:A vi-centric family tree of editors (2000) by Tenobrus on Sunday November 27, 2016 @10:46PM (#13053275)
True, but it's pretty reasonable for your nested OS to take a while.
Re:A vi-centric family tree of editors (2000) by JdeBP on Monday November 28, 2016 @11:07AM (#13056261)
Enjoy, then, the need to run a whole bunch of background daemons in order for some "small and lightweight" text editors to run at all. (-:

* https://news.ycombinator.com/item?id=13056252

Re:A vi-centric family tree of editors (2000) by zeveb on Monday November 28, 2016 @01:03PM (#13057168)
emacsclient is even more instant than vi, in my experience.
Re:A vi-centric family tree of editors (2000) by kruhft on Monday November 28, 2016 @01:39PM (#13057419)
An old post I wrote (2006) on a way to improve emacs startup times by loading commonly used packages into your core for instant startup time:

http://web.archive.org/web/20060501032837/http://metashell.b...

Re:A vi-centric family tree of editors (2000) by aerique on Monday November 28, 2016 @04:58AM (#13054458)
You can learn both. I prefer Emacs as an environment but use Vim keybindings within because they're so ubiquitous and pretty good.

https://www.emacswiki.org/emacs/Evil

Re:A vi-centric family tree of editors (2000) by snarfy on Monday November 28, 2016 @09:40AM (#13055631)
They have different workflows. Emacs can edit remote files.

With vi, you ssh to the remote machine, run vi and do your edits, then log out.

With Emacs, you ssh to your machine wherever it is already running Emacs, and use the remote edit features. You never close Emacs.

Re:A vi-centric family tree of editors (2000) by convolvatron on Sunday November 27, 2016 @10:03PM (#13053133)
vi was part of unix that came from at&t. i mean they still shipped ed, but

emacs was a thing developed and ported from other operating systems.

Re:A vi-centric family tree of editors (2000) by kps on Monday November 28, 2016 @11:01AM (#13056225)

  > vi was part of unix that came from at&t.
And that's why USL settled the BSD lawsuit. https://en.wikipedia.org/wiki/UNIX_System_Laboratories,_Inc....
Re:A vi-centric family tree of editors (2000) by zappo2938 on Sunday November 27, 2016 @10:35PM (#13053238)
vim Adventures is the only reason I would use vim over emacs. [0]

[0]: http://vim-adventures.com/

Re:A vi-centric family tree of editors (2000) by aq3cn on Monday November 28, 2016 @06:45AM (#13054810)
Wow, what a game. First I had impression of Mario, then mine sweeper and finally pacman. But it was none of them but a new category of a game. Can you recommend some more fun learning stuff related with me. You can also share it using /r/vim too.
Re:A vi-centric family tree of editors (2000) by sillysaurus3 on Sunday November 27, 2016 @08:30PM (#13052799)
It's probably best to learn both. I usually switch back and forth. Just spend a week or so forcing yourself to use only vim and you'll never forget it.
Re:A vi-centric family tree of editors (2000) by vowelless on Sunday November 27, 2016 @08:34PM (#13052819)
Blasphemy! You should only use vim.

(/s kind of... I just love vim too much)

Re:A vi-centric family tree of editors (2000) by sillysaurus3 on Sunday November 27, 2016 @08:37PM (#13052829)
I used to feel similarly, but vim inside emacs is pretty sweet. The emacs package "evil" gives almost perfect vim emulation. Suddenly the entire emacs ecosystem is available to anyone who knows vim. And the ecosystem is massive.
Re:A vi-centric family tree of editors (2000) by joatmon-snoo on Monday November 28, 2016 @12:38AM (#13053626)
As a vim user who's yet to learn emacs...

wat.

Re:A vi-centric family tree of editors (2000) by weaksauce on Monday November 28, 2016 @01:11AM (#13053727)
Try spacemacs. It's really good. Most advanced vim stuff works as well as or better than in vim.
Re:A vi-centric family tree of editors (2000) by bootload on Sunday November 27, 2016 @09:06PM (#13052920)
"why emacs is almost never installed by default while vi(m) is?"

Memory footprint of emacs is? Vs memory footprint of vi? I've had problem machines where no OS is installed and working in low memory cf: ~ https://slashdot.org/~goon/journal/49959 so steps like ^copying bootblack to disk and hexifying using vi(m) and hexman^ for example, painful in Ed, impossible in emacs, are made bearable in vi.

Re:A vi-centric family tree of editors (2000) by davidgerard on Monday November 28, 2016 @05:49AM (#13054637)
vi is part of what's expected on a Unix and made it into the various standards - if you're on even a weird Unix, it's going to have some sort of vi on it.

emacs never made it to that status, even as it was contemporary with vi.

Re:A vi-centric family tree of editors (2000) by eltoozero on Sunday November 27, 2016 @10:23PM (#13053199)
Not a comment on why, but when I first asked the elusive n00b question "vi or emacs?" to a thick-skin, the response was:

"Emacs is like a beautiful woman, but vi is like your hand; it will always be there."

Related: it's pronounced "VEE EYE" if you're a "JIFF" person. And anything but "six" otherwise.

I like "jiff" but prefer "vye", so whatever.

And as I understand it's called vi because of 'visual' mode of 'ed' line editor.