I want to learn Emacs or Vi. I don't like modal editing but Vi is ubiquitous and looks more useful for emergencies. What are the reasons why Emacs is not preinstalled in most distributions?
2 Answers
The direct answer is probably that vi
is part of the POSIX standard (as @jasonwryan also mentioned in a comment), as well as the Single UNIX Specification. As such, anything that calls itself POSIX-compliant probably includes something vi
-like, and anything that wants to call itself UNIX has to, or you don't get certified. Not just vi
, but the related line editor ex
and the scripting language involved are also part of these standards. emacs
is not part of the standard, so it is not included.
As for why this is so, there are several reasons. For one, emacs
is far, far bigger and more complicated than vi
. There's a whole LISP in there, among other things. The part of POSIX that decides this was written in 1992, when you would need a very beefy computer for emacs
. I've seen a vi
run on Minix on a 286 semi-decently. And while it doesn't really matter all that much for a modern desktop, on embedded systems it still very much does. Its size and versatility also makes it harder to check it for security holes, which might be an issue in certain applications where security is imperative. Basically, everything that might make it a better desktop application makes it a worse system component.
If you're up for a history lesson, you could also say that vi
is closer to the Unix philosophy: do one thing and do it well. Indeed, vi
sprang from ex
, and has always been an Unix program. emacs
sprang from a vastly different world: it was originally built on top of TECO, written for the ITS operating system. It was only ported to Unix in the 1980s, as ITS was dying out. This makes emacs
in effect an immigrant from a very different culture, while vi
is a native.
Interestingly, both emacs
and vi
first came out in 1976, so it's not just that vi
is older.
-
4"This makes emacs in effect an immigrant from a very different culture, while vi is a native." Beautifully put. +1 Apr 5, 2015 at 3:31
-
1It is probably no longer the case that "emacs is far, far bigger and more complicated than vi.", at least in the current most popular incarnation of
vi
, namelyvim
. There is currently an entire SE site devoted solely tovi
and its avatars, includingvim
. Apr 5, 2015 at 9:24 -
1@FaheemMitha:
vim
is still a lot smaller thanemacs
. At least the ones you get from Debian's repository, theemacs
executable is five times as large as thevim
one. It also has more dependencies. But that's just one particular implementation. There's a serviceablevi
in BusyBox, you can find it running on modems and such. It's not very full-featured, but it is obviously stillvi
. You could not do that withemacs
and still call itemacs
.– marinusApr 6, 2015 at 16:46 -
-
1My question was put on hold as primarily opinion-based. I think it's not opinion-based and you proved it giving an objective and complete answer :)– user109218Apr 7, 2015 at 1:48
This is not how it works.
The choice of packages installed by default is typically driven by practical needs. There is no single practical reason to add particularly emacs into a default installation, unless you are installing a distribution specifically focused on emacs users, if there is anything like that at all.
A typical linux distribution by default installs a minimal system plus what the userbase is expected to use (very often a graphical desktop, firefox, libreoffice and a couple of tools). If emacs is not part of the minimal system, it doesn't make sense to have it in the default installation.
A minimal system is there to allow a power user (administrator) to run the system, perform basic configuration tasks using the command line, and install whatever he wants.
There is certainly need for a text editor in such a minimal system, as you may need to edit configuration files. A good minimal candidate is nano as it's both easy to use and very small in footprint, therefore you will find it in minimal systems of most distributions nowadays. Another good candidate is a simple implementation of vi because, as others mentioned, it's the standard editor on POSIX systems. That is why minimal systems typically contain those two, sometimes only one of them.
An entirely wrong choice would be emacs which is not minimal, not easy to use as nano and not standard as vi. Another rather poor choice would be a full installation of vim. Those are tools that belong to full installations ranging from your complete home setup with your favourite editor to university setups for shared computers with a choice of installed tools for a wide range of users.
man sh
in Rationale: The community ofemacs
proponents was adamant that the fullemacs
editor not be standardized because they were concerned that an attempt to standardize this very powerful environment would encourage vendors to ship strictly conforming versions lacking the extensibility required by the community.