Let the editor wars begin!

Well Armed

Vi

Bill Joy designed Vi to be the "visual mode" for the ex editor. It was part of the original ex via the visual command but wasn't its own binary until about 1979. Vi is a screen-oriented editor, in contrast to the line orientation of ex.

In general, Vi [4] is a modal editor. It operates in a particular "mode" such as Insert mode or Normal mode. When in Insert mode, for the most part, the keystrokes are interpreted to be text that is inserted into the file. In Normal mode, the keystrokes are taken to be commands. Knowing which mode you are in is one of the earliest aspects of Vi that needs to be mastered.

Figure 1 shows an image of Vi running in Normal mode on my Linux CentOS 6.8 desktop. At the bottom of the screen is the colon (: ) prompt for the Vi commands.

Figure 1: Vi 7.4.629 on CentOS 6.8.

The rivalry between Vi and the next CLI editor, Emacs, is HUGE [5].

Emacs

Emacs [6] is arguably the "Swiss army knife" of editors. It is extremely extensible and customizable, including the extensive use of macros. It has more than 2,000 commands built-in to the tool and includes a dialect of Lisp named Emacs Lisp [7] that allows users to write new commands. Development started in the 1970s at the MIT Computer Science and Artificial Intelligence Laboratory [8] and continues to this day. Richard Stallman [9] started work on GNU Emacs [10] in 1984. Emacs has had a number of versions over the years and has been forked several times.

One of the features that attracts people to Emacs is its ability to work with other applications (i.e., very *nix-like). For example, from within Emacs, users can read their email, compile code (i.e., similar to an IDE), use a calculator, interact with a spreadsheet, check news feeds (RSS), or browse the web. Essentially, Emacs becomes the center of one's working environment. In fact, some users only use Emacs because it can reach so many other tools. What you use Emacs for is up to you, and you are not forced to use it for everything.

Emacs can split the main editing window into separate "panes" (Figure 2). It has had this ability before GUIs were available. Each pane has a status bar at the bottom. The classic example of splitting the main window into panes is to have one pane on top for editing code and one pane at the bottom for compiling and testing the code. This allows Emacs to be used as an IDE. In CentOS 6.8, the command emacs starts the GUI version.

Figure 2: Emacs 23.1 on CentOS 6.8.

Nano

Nano [11] is designed to be a simple editor that can be used in a console. It is based on Pico [12], which is part of the Pine [13] email client, but it has had some functionality and new features added, such as regular expressions.

In the past couple of years, I have seen much more interest in Nano (Figure 3), partly, I believe, because Nano has the command help at the bottom of the screen at all times, which, if you don't use Nano very often, can be very, well, helpful. Another reason it might be so popular is because a new influx of users who have no preconceived notions of a *nix editor such as Vi or Emacs have adopted the easiest CLI editor they could find.

Figure 3: Nano 2.0.9 on CentOS 6.8.

Nano was released in 1999 as free software. It joined the GNU Project in 2001. Development under this umbrella proceeded for several years until June 2016 when the current principal developer and the other active members of the nano project decided to leave the GNU project, leaving GNU nano intact but taking active development outside of GNU (a fork). This move was taken because of their objections over the Free Software Foundation's copyright assignment policy.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=