August 17, 2013

5 free Linux text editors for programming and word processing

A programmer looks at the current versions of five well-known text editors and offers his take on how well they perform.

By Himanshu Arora
July 31, 2013 06:00 AM ET

Computerworld - Today's Linux text editors bridge the gap between the needs of high-end programmers and those of day-to-day users. These applications offer a range of functionality, from clean and user-friendly interfaces (preferred for normal text editing) to power-packed features (required for programming).
Most Linux users I've talked to tell me they want a text editor that can be used for normal text editing (and even some word processing) as well as for hard-core programming and coding. And, of course, they're looking for a low learning curve.

In this roundup, I assess five of the most well-known free text editors -- Gedit, GNU Emacs, GNU Nano, KATE and Vim. I have been using Linux for the past six years now, and my views are based on the practical experiences that I have had with each of them.
While most review round-ups try to answer the question "Which product is the best?" the real question in this case is: "Which one is best for you?" It all depends on what you require -- whether you are more comfortable with easier, graphic-based interfaces or just want a solid, down-and-dirty text editor. The following should provide some guidance as to where to look.



Gedit

Developers: Paolo Maggi, Paolo Borelli, Steve Frécinaux, Jesse van den Kieboom, James Willcox, Chema Celorio, Federico Mena Quintero
Latest version: 3.8.1
Linux support: Flavors that support Gnome
License: GPLv2
Sometimes all you need is a simple text editor with a clean and easy-to-use interface.
Gedit -- the official text editor for Linux flavors that support the Gnome desktop environment -- is a simple yet useful graphical text editor that is often the first choice of users who are new to *nix systems. This editor has been part of the Gnome project since the project came into existence in 1997.


Gedit
Gedit

What's new

Gedit includes a variety of strong features including UTF-8 support, syntax highlighting, the ability to edit files kept at remote machines, text wrapping and tab support. The latest version of Gedit (3.8.1) introduces a Zeitgeist plugin to use the libzeitgeist2 library, some improvements in the documentation and miscellaneous bug fixes.

What's good about it

Besides being a good text editor for newbies, Gedit provides many features that make it programmer and developer friendly. These include auto indentation, line numbers, bracket matching, backup files and auto-save files. Another nice feature is its ability to recognize and open most file formats with syntax highlighting.
I personally like the ability of Gedit to open files in tabs (as in a browser), which makes switching between files really easy.
There are some other nice features. For example, if you are programmer and your manager is very strict about code indentation, you can disable tabulation and opt for auto indentation by checking the corresponding options in the Edit --> Preferences --> Editor menu.
Gedit includes a plugin facility through which various plugins -- offered with Gedit or from third parties -- can be added. This flexibility results in enormous power.

What needs to be fixed

As a programmer, I feel that Gedit could do more by adding features such as code folding into its armory. When handling huge files, it is really useful if you can fold/collapse irrelevant sections and work only on those sections that require editing.
Another minor problem: When using #if 0 and #endif to comment on C/C++ code, the comments are the same color as normal text comments. So if you have lots of text comments in your code and somewhere in-between you have a commented block of code, then it sometimes becomes difficult to identify the commented code.

Bottom line

Gedit is very simple to learn and use -- you only have to learn various configuration options if you need advanced features.

GNU Emacs

Developer: Richard Stallman / GNU Project
Latest version: 24.3
Linux support: All flavors
License: GNU GPLv3
GNU Emacs -- the name is derived from "Editing Macros" -- is an advanced text editor and a popular ported version of the Emacs text editor.


GNU Emacs
GNU Emacs
Because the original Emacs (which was written by Richard Stallman and Guy L. Steele, Jr.) was not a free product, Stallman rewrote practically all the code. Released in 1984, GNU Emacs became the first free software under the GNU umbrella. Though Stallman has been the chief maintainer of the GNU Emacs project, most of the maintenance work since 2008 has been overseen by Chong Yidong and Stefan Monnier.

What's new

GNU Emacs is one of the oldest text editors around, but it's still being developed and maintained actively. The latest stable release -- 24.3 -- was released on March 11, 2013.
This release includes several major improvements, including an update for the Common Lisp emulation library, and a new major mode for Python, among others.

What's good about it

Written in C and Emacs Lisp (a dialect of the Lisp programming language), GNU Emacs is a user-friendly, customizable, and extensible text editor. It includes almost all of the features that are required in a good text editor.
For example, it offers context-sensitive editing modes, good tutorials and built-in documentation for new users, complete Unicode support for most human languages, and extensions to add new functionality. In addition, GNU Emacs is capable of printing and formatting documents just like a word processor, which isn't all that usual in a programming text editor.

What needs to be fixed

Beside a steep learning curve, the major downside of GNU Emacs is its relatively slow performance. When compared with other text editors, GNU Emacs runs a bit slower because the Lisp code takes time to load and interpret, which can cause performance issues when dealing with very large files. But for daily usage, with average-sized files, this shouldn't be an issue.

Bottom line

Despite being more than three decades old, GNU Emacs still holds its ground with a large and loyal following. The fact that it is still actively maintained, is user-friendly and comes with built-in documentation and tutorials makes it a worth using for day-to-day text editing work.


GNU Nano

Developer: Chris Allegretta
Latest version: 2.2.6
Linux support: All flavors
License: GNU GPL
GNU Nano is a command-line text editor created in 1999 to provide a free alternative to the proprietary text editor Pico. Initially it was named TIP (for This Isn't Pico), but in 2000 it was renamed because of an existing Unix utility called Tip. In 2001, GNU Nano was (and still is) included in the GNU package.


GNU Nano
GNU Nano

What's new

Nano contains all the basic features of a standard text editor. It was actively maintained until 2010, but since then activity seems to have slowed down a bit. The latest version of Nano is 2.2.6, which, according to change logs, was released on November 22, 2010.
This release adds a section to the FAQ about how to use nanorc (Nano's RCFile) on Win32 systems and returns the check for restricted mode to the spell-checker.

What's good about it

Nano is the text editor that pops up by default when you run the visudo command on Ubuntu Linux (to edit sudoers information). It contains all the functionalities and features of Pico but adds some extra features, such as regular expression-based search and replace, smooth scrolling and colored text.

Another good point about Nano is that it is lightweight and easy to use. I was really impressed by the way that all the basic commands are mentioned at the bottom of the window -- so as a new user, you don't have to look for a basic tutorial to get started.

What needs to be fixed

The only problem I have with Nano is that it was created to emulate Pico -- which was not a feature-rich editor. Though Nano adds some extra features, it still stands behind Vi/Vim editors, which are more powerful command-line text editors that provide a variety of features.

Bottom line

GNU Nano is a small and lightweight text editor that may not work as a full-blown IDE (integrated development environment) for programmers but is still capable of handling standard text editor tasks. Despite being command-line based, it is simple and easy to use.

KATE

Developer: KDE
Latest version: 4.10.5
Linux support: Flavors that support KDE
License: LGPLv2
KATE -- KDE Advanced Text Editor -- is an ideal choice for any KDE user who is looking for a great GUI-based programming text editor, especially for an IDE. KATE has been included with the KDE software package since 2001.


Kate
KATE
It can also be used with KDevelop, Kile and other KDE applications as an editing component.

What's new

With the release of KDE 4.10, many new features have been added to KATE. Open bugs were reduced from 850 to 60, while new features include a new project management plugin, new quick open functionality (which allows a hot key -- Ctrl+Alt+O in KATE -- to open one or more files quickly) and an optional "minimap" that can be used as a scrollbar.

What's good about it

KATE gives the knockout punch to heavy and complicated IDEs by providing features that help create projects. For example, it offers a project view that makes it easier to search, edit and compile code files. The screen is divided in two main parts: The left part lists files and folders in a tree view, while the right part is for editing the currently selected file.

Another smart feature is the ability to open a search bar in the right view of its window. You can start typing a name and KATE will suggest all the matching file names -- very much the way that Google makes suggestions when you type a search query. It's a lot simpler to find files this way as compared to using your mouse to navigate through a tree structure.
Besides standard features, KATE comes with support for GDB and breakpoints (for debugging). This is very helpful for programmers who need to do a lot of debugging.
With all these features (and more), KATE feels more like a full-blown IDE than just a programming text editor.

What needs to be fixed

One of the biggest downsides of KATE for me is that it comes as a part of the KDE package, which means that it will not work well with other popular desktop environments such as Gnome. And in general, I feel that programming using GUI-based editors is a bit slow when compared to command-line based editors (mainly due to mouse usage).

Bottom line

Go for KATE if you develop and/or program on a KDE-supported system but do not like purely command-line programming editors. I think it's the closest a GUI text editor can get to an IDE.


Vim

Developer: Bram Moolenaar
Latest version: 7.3
Linux support: All flavors
License: GPL
Vim (which originally stood for Vi Imitation but now stands for Vi IMproved) is a text editor that was originally designed by Bram Moolenaar in order to have a good Vi clone for the Amiga platform. Moolenaar started working on it in 1988; its first release was on November 2, 1991.


Vim
Vim
Since then it has been ported to a variety platforms, including Linux, Windows, Mac OS X and QNX.

What's new

Vim was initially designed to be used as a terminal-based text editor; however, there are many GUI front ends available for it today. The latest release (version 7) came out in 2006 and introduced some prominent features like spell-check, auto-complete, undo branches and a tabbed interface. Version 7.3 (released in 2010) is the latest minor release that adds features such as Python 3 support and a persistent undo feature.

What's good about it

Vim is a command-line editor. This means that you do not have to take your hands off the keyboard while editing any kind of file with Vim. Once you are used to it, this makes editing very fast.

To start typing text, you enter into insert mode (usually by typing i); to do other operations like copy, paste or replace, you need to come out of insert mode by hitting the Escape key. You can then run commands, which are nothing but key combinations. For example, to delete a line, you place the cursor on that line and press dd. Similarly, yy can be used for copying and p can be used to paste a copied or just deleted line.
Syntax highlighting -- highlighting different categories of text in various colors and/or fonts -- is another powerful feature of Vim. Over 200 languages are supported; you can also create your own syntax. Vim also highlights programming errors -- I have written numerous C programs using Vim, and the way it highlights mistakes such as a missing or extra bracket is very helpful.
If you are an existing Vi user, Vim will definitely strike the right chord with the set of improvements it brings over Vi. For example, Vim comes with an unlimited undo feature (as compared to the last command undo supported by Vi). Vim can also be used for editing files placed within an archive such as zip or tar.

What needs to be fixed

As a command-line-based editor, Vim is widely perceived as an editor for hard-core programmers and tech experts. Although this isn't necessarily so (I have many friends who aren't hard-core experts who have switched to Linux and like using Vim whenever working on command lines), it could put off less experienced users.
Secondly, because almost every key press has its own action, if you are new to Vim, you can get frustrated with the mess that can be created by accidental key presses. As with any other software, continuous learning and practice is the key.

Bottom line

Being a feature-rich command-line text editor, Vim has a very steep learning curve if you want to explore it to its potential -- but it's well worth it. You won't understand just how powerful, configurable and extensible Vim is unless you start using it.


Conclusions

Each text editor reviewed here has its own good qualities. Which you use depends on both your requirements and your own work habits.


Vim is undoubtedly best for those -- like system admins -- who need a feature-rich command-line programming text editor. For normal editing, the learning curve is not very high, but for using it as an IDE, a level of expertise is required.


KATE is a good alternative for those who are not comfortable with command-line text editors. It is one of the best GUI alternatives for Vim, although it works best with KDE.
Gedit doesn't compare with Vim and KATE in terms of features but, because of its wide range of plugins and other features, it enjoys a wide following. I personally prefer Gedit when I edit single source files, makefiles and configuration files. I've heard other users say that just after migrating from Windows to Linux, Gedit made them feel home. The only limitation is that it is a Gnome application and is not supported by KDE (although there are some workarounds).

Like Vim, GNU Emacs has a steep learning curve despite its GUI environment. But as with Vim, the more you learn about GNU Emacs, the more powerful and in control you feel about this text editor. Its ability to compile code, get the compiled output and jump to erroneous lines, among others, places Emacs a step ahead of text editors such as Gedit.
Talking about Nano usually brings up a comparison with Vim. I would say that using Nano or Vim is just a matter of choice. People who like Nano think of Vim as complicated computer, while those who like Vim think of Nano as a piece of paper -- easy to use but not much can be done with it.


My advice? If you are new to command-line text editors, go for Vim (it requires some hard work to learn, but it's worth it), but if you have been using Nano and it suits your purposes, there's no harm in staying with it -- it's definitely easy to use.

This article, 5 free Linux text editors for programming and word processing, was originally published at Computerworld.com.
Himanshu Arora is a software programmer, open source enthusiast and Linux researcher. Some of his articles have been featured in IBM developerWorks and Linux Journal. He (along with some like-minded friends) blogs at MyLinuxBook.
Read more about Linux and Unix in Computerworld's Linux and Unix Topic Center.

Source: http://www.computerworld.com/s/article/9241134/5_free_Linux_text_editors_for_programming_and_word_processing?taxonomyId=122&pageNumber=1