In the beginning was ed, a simple bare-bones line editor developed in 1969 and shipped with Unix. Back then, personal computers didn’t exist and most computer programmers accessed programs via a terminal to a central server. Because memory was sparse and networking technologies were much slower (remember dial-up? This was a decade before the predecessor of dial-up was invented and when ARPANET was still state-of-the-art technology), it was only practical to edit files one line at a time instead of the whole file. In ed, many operations were formed with single keystrokes, such as pressing ‘a’ appended text to a file and pressing ‘i’ inserted a line before the current line, not to speed up user operations but to minimize data sent to the terminal.
According to Wikipedia, ed was “user-unfriendly” and in 1975, an improved version was made: ex, representing EXtended. ex was also a line editor but with more intuitive commands and contained commonly used operations, including substitutions. It also had its own POSIX standard (1003.1).
In a few short years, display technologies improved and ex developed a visual mode that enabled seeing and operating on many lines at a time. ex would no longer be confined as a line editor; it grew up into a screen editor! This screen editor became known as vi, representing “Visual”. vi also had more commands and modes, and could easily switch to using ex commands by pressing “:”.
Almost 15 years went by before a new editor based on vi was developed: Vim , representing “Vi Improved”. Vim was a superset of vi, having more features and improved extensibility. It was 99% compatible with vi with many keys representing the same operations. Vim comes installed on almost all modern Unix-derived systems, including macOS and Linux.
Lately, the source code for Vim has been forked into a repository known as Neovim . It is almost exactly like Vim but with a refactored codebase. Here’s what one contributor had to say about Vim ’s codebase:
“Indentation is haphazard. Lines contain tabs mixed with spaces. Source files are huge. There are almost 25,000 lines in eval.c. That file contains over 500 #ifdefs and references globals defined in the 2,000 line globals.h. Some of Vim’s source code isn’t even valid text. It’s not ASCII or UTF-8. The venerable file can’t figure out the encoding. Many of Vim’s #ifdefs are for platforms that became irrelevant decades ago: BeOS, VMS, Amiga, Mac OS Classic, IRIX.”
So far, Neovim tagged on version 0.2 with almost 9000 commits and 320 contributors. It’s still in its infant days and we will see how much traction it gains in the upcoming years.
(Sorry Emacs users for not including your favourite editor. I might write an article about Emacs if or when I learn it one day. In the meantime, go Vim !)