Essential Programmer's Editor Features

Programmers spend most of their day in a text editor. It had better be a good one. I use WinEdit, which has most, but not all, of these features.

Multiple document interface, preferably with tabs for rapid switching between files. Other optional window arrangement might include side-by-side and cascading.

Auto-indent. A very simple feature which saves hours of time. When you press the carriage return, the cursor returns to the current level of indentation.

No tab characters. Whether you press the tab key or use the auto-indent feature, the editor fills in by inserting space characters, never by inserting tab characters (ASCII 9). An Options dialog allows you to specify how many spaces to use, defaulting to four.

Syntax coloring. Minimal syntax coloring highlights keywords, comments, and string literals. Really good syntax coloring highlights doc comments and numeric literals as well. An Options dialog allows you to specify which colors you want to use.

Different file types. At a minimum, the editor should distinguish text files (*.txt) from code files (*.java). Really good editors recognize HTML (*.html) and other file types and support syntax coloring and other options (such as spaces-per-tab) for each.

Unlimited Undo. At least a dozen levels of Undo/Redo. Better editors have unlimited (constrained only by available memory) levels of Undo/Redo.

Customizable keyboard mapping. I like to use Ctrl-Y to delete the current line. Every user has his favorite keyboard shortcuts. A good editor lets you map any keystroke to any command.

Left margin line selection. I don't know who invented this, but I first saw it in MS Word 1.2. When you position the cursor near the left margin, the arrow flips and points to the right. When you click there, you select the whole line.

Macro language, and a menu of your own. I like to insert pre-formatted blocks of code, such as if-then-else, switch, try-catch, doc comment templates, event Listeners, and so on, at the current indentation level. WinEdit lets me do this with a macro language and a customizable Macro menu.

Customizable Tools menu. A Tools menu lets you run external programs. Options let you specify the command line and parameters, pass the current file name to the program, and capture the program's output to the output window. I like to "wire up" javac.exe, java.exe, javadoc.exe, attrib -r, Jindent, and a number of programs which take the contents of the clipboard, munge it, and copy the result back into the clipboard.

Output window error parsing. A really good editor captures the output of external programs, such as a compiler, in an output window. When you double-click on a compiler error, the editor parses it to find the file name and line number, opens up that file, and scrolls to the specified line.

Built in Grep. WinEdit calls this Find in Files, and lets you specify a file type, a start directory, whether to recurse subdirectories, and a search string or regular expression. The results go to the output window, where you can double-click on them as described above.

Window menu. With Save All, Close All, and a list of current documents.

Block indent and unindent. Select a block of text and use Tab and Shift-Tab to indent or unindent.

Find menu. With Find, Change, Next, Previous, etc. A really good editor lets you search and replace with special characters, such as tab characters and end-of-line characters, almost to the point of regular expressions.

Status line, showing line number, column number, file size, number of lines, etc. This helps in interpreting stack traces.

Many configurable options. Including fonts, file types, keyboard mapping, backups, warnings, etc.

Good printing Shouldn't have to mention this, but amazingly, some editors lack it.

List of previous files. This time-saving feature keeps a list of the most recently opened files so you don't have to negotiate the standard file dialog every time.

Save and restore workspace. The editor should at least remember which files you had open. Really good editors pick up exactly where you left off, to the character.

HTML-savvy Find. A really good editor's Find in Files would have an HTML search option that would ignore everything in angle brackets, allowing you to search HTML documentation just as you would plain text.

FTP Open and Save. A really good editor works with remote files as well as local ones.