Get the highlights in your inbox every week.
Jove, a surprisingly small and effective Emacs clone
By Jove! It's a lightweight alternative to Vim
Some people like Vim as a text editor, and other people like Emacs. Having such different opinions are the way of the UNIX world.
I'm an Emacs user through and through. Sure, I spent a few obligatory years in my early days of UNIX using Vim, but once I learned Emacs properly, there was no going back. The thing about Vi(m) is that it's on nearly every UNIX box because it's been around forever, and it's pretty small. It's the obvious choice for a default editor that people can use in a pinch.
Without taking into account deliberate optimizations and carefully selected configuration options, the "natural" difference in size between Vim and Emacs is roughly 1 to 7 (I maintain an Emacs module for the live Linux distribution Slax, where Emacs is 37MB to Vim's 5MB. Similarly, on my NetBSD box, a minimal build of Emacs is 14MB and Vim is around 2MB).
To be fair, GNU Nano is also small and is a pretty fair and, lately, popular choice as the default text editor. The problem with both Nano and Vim, though, is that neither of them are Emacs. The problem with Emacs is that it's really, really big.
Delving into Emacs
Emacs started as a set of macros for an existing text editor called TECO. The idea was pretty straightforward: TECO occasionally had features that required six steps that were easier if scripted and turned into a single step. Eventually, people saw that the macros were so sensible that they gathered up them up and bundled them together as a standalone, interactive editor.
To most people, "Emacs" suggests two different principles:
- A text editor with a specific style of functionality (keyboard commands centered around
altcombinations) and a general overall "feel" and style. This is the "manual or automatic?" part of Emacs.
- A robust Lisp interpreter that is endlessly extensible and hackable. This isn't what most people think about when trying Emacs for the first time—it's the stuff under the hood.
Most of the weight of an Emacs binary is found in the place where these two sides of Emacs conjoin. Emacs itself (the text editing part) isn't very heavy. Add in all the cool tricks it can do (view PDF and docx files, load in additional menus, use a GUI front end, and so on) and the application becomes heftier. Add to that a complex config file, and things get even more convoluted.
Jonathan's own version of Emacs
Jonathan Payne wrote his own version of an Emacs editor and called it Jove. Today, it's something of a niche application that doesn't get talked about much, but it's a surprisingly small and effective Emacs clone. When you're in Jove, you hardly realize that you're not using Emacs. In fact, Jove is so much like GNU Emacs that its inbuilt tutorial, teachjove, is the Emacs Tutorial with only slight modifications. This means you get the most commonly used benefits of GNU Emacs, but with a tiny footprint and a trivial list of dependencies:
ncurses-style elements, and
How small is it? The Jove executable is roughly 150K.
Jove ships with Slackware by default, so I don't even bother installing Vim. Because so many applications seem to want to default to Vim, I go so far as to alias Vi to Jove.
If you're on a distribution that doesn't provide a Jove package, you might be able to rebuild a package for your distribution from a source package. For example, RHEL and CentOS don't have Jove packages, but Fedora does. As long as you have the RPM development toolchain installed:
# yum grouplist -v
# yum groupinstall fedora-packager
Download the source RPM for Jove (it should have
src.rpm in its file name), and then rebuild the SRPM:
$ rpmbuild --rebuild jove-22.214.171.124-10.fc24.src.rpm
Find the rebuilt RPM in your user's
~/rpmbuild/RPMs/ directory in the appropriate architecture. Install it as usual. For example:
$ sudo dnf install ~/rpmbuild/RPMs/jove-126.96.36.199-10-el7.rpm
If all else fails, the source code for Jove is maintained at the University of Toronto.
The part of the GNU Emacs experience that Jove leaves out is Lisp. For hardcore users of Emacs, this makes Jove a noncontender as an Emacs, but as a replacement for Vim, the absence of Lisp simply means you get a lightweight nonextensible editor with the same look-and-feel as GNU Emacs. The best way to find the differences between Emacs and Jove is to use Jove. You'll run into the differences eventually, but there are a few tricks that can help you adapt.
You can remove the Vim package if you really want to, but on some distributions doing so is more work than it's worth. For instance, on a RHEL server, both cvs and sudo "require" Vim. The executables don't actually require Vim, of course, but their RPM packages have been told that they do, so that's what yum or dnf will report.
It's easier and safer to just set a proper
EDITOR environment variable. To do that use:
$ echo "EDITOR=/usr/bin/jove" >> ~/.bash_profile
$ sudo !$
$ source ~/.bash_profile
$ sudo !$
Most applications respect the
EDITOR environment variable (even
visudo, which, given the name, you might not expect). I've seen a few oddities that ignore it and stubbornly load Vim anyway, but in my experience those are rare.
If you absolutely must, you can symlink Jove to Vi, as long as you keep the actual Vi executable around for emergencies. Because Vi is installed to
/bin, it's the one text editor you'll have in the event of a system rescue when
/bin is the only mounted partition (unless you manually install something else to
/bin). A safe option is:
$ sudo mv /bin/vi /bin/vi.bin
$ sudo ln /usr/bin/jove -s /bin/vi
You should only do this if you know what you're doing and understand how it will affect a rescue environment.
If you're not a Emacs or Jove user already, you should first launch teachjove for a step-by-step introduction. Be careful, if you're currently a happy Vim user, this may change your world view. If you're a Nano user, this gives you a glimpse at what you're missing.
Jove ships with several .jove.rc.* files with all the usual defaults an Emacs user might expect.
$ cat /path/to/jove/jove.rc.xterm > ~/.joverc
This serves as both a safe starting place for getting used to Jove as well as an example of the customizations possible. The most common change to make, surely, is the behavior of the Forward-Delete key, which for historical reasons is set to act as a backspace:
# DEL key
bind-to-key delete-next-character ^[[3~
# Backspace key
bind-to-key delete-previous-character ^?
As with GNU Emacs, the command
M-x apropos foo (or
M-x apr foo for short) performs a search within all possible commands for the term
foo. If you run into something in Jove that isn't like what you're used to with GNU Emacs,
apropos a keyword to find the jovial replacement.
Usually there are two reasons for a function to be "missing" in Jove. Either it doesn't exist (there's no
org-mode, and no amount of
apropos org-mode is going to change that), or it's just got a different invocation because you're not using Lisp any more.
For instance, in GNU Emacs the
global-linum-mode function toggles line numbers along the left border of each buffer. Jove has no such function, but
apropos number reveals the
number-lines-in-window, which does exactly the same thing.
If you run into a feature you think is missing, use
M-x apropos and adapt. If your feature really is missing, just remind yourself that at least it's not Vim.
Emacs vs. Vim vs. Jove
You might argue that Jove is unnecessary, since Emacs can be invoked in different ways so as to avoid your init file or to act lightweight. Or you may argue that Vim doesn't need replacing if the
EDITOR environment variable is managed correctly (and respected by all applications, which it is not). All of these are valid opinions, and in the end, Jove is just another text editor. It's a small utility that makes editing text moderately easier than
If you're in the market for a quick, painless Vim replacement and you love the user style of Emacs and Bash, then Jove might be the backup Emacs for you.