Text editor

From Wikipedia, the free encyclopedia - View original article

 
Jump to: navigation, search
An example of a text editor, Vim

A text editor is a type of program used for editing plain text files.

Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code.

Plain text files vs. word processor files[edit]

There are important differences between plain text files created by a text editor and document files created by word processors such as Pages,[importance?] Microsoft Word, and WordPerfect.

Word processors were developed to allow formatting of text for presentation on a printed page, while text produced by text editors is generally used for other purposes, such as input data for a computer program.

When both formats are available, the user must select with care. Saving a plain text file in a word-processor format will add formatting information that could disturb the machine-readability of the text. Saving a word-processor document as a text file will lose formatting information.

History[edit]

A box of punched cards with several program decks.

Before text editors existed, computer text was punched into punched cards with keypunch machines. The text was carried as a physical box of these thin cardboard cards, and read into a card-reader. Magnetic tape or disk "card-image" files created from such card decks often had no line-separation characters at all, assuming fixed-length 80-character records. An alternative to cards was punched paper tape, which could be punched by some teleprinters (such as the Teletype), which did use special characters to indicate ends of records.

The first text editors were "line editors" oriented to teleprinter- or typewriter-style terminals without a display. Commands (often a single keystroke) effected edits to a file at an imaginary insertion point called the "cursor". Edits were verified by typing a command to print a small section of the file, and periodically by printing the entire file on a printer. On some line editors, the cursor could be moved by commands that specified the line number in the file, text strings (context) for which to search, and eventually regular expressions. Line editors were drastic improvements over keypunching. Some line editors could be used by keypunch; editing commands could be taken from a deck of cards and applied to a specified file.

When computer terminals with video screens became available, screen-based text editors (sometimes termed just "screen editors") became common. One of the earliest "full-screen" editors was O26 - which was written for the operator console of the CDC 6000 series machines in 1967. Another early full-screen editor is vi. Written in the 1970s, vi is still a standard editor[1] on Unix and Linux operating systems. Vi and Emacs are popular editors on these systems. The productivity of editing using full-screen editors (compared to the line-based editors) motivated many of the early purchases of video terminals.

Types of text editors[edit]

Some text editors are small and simple, while others offer broad and complex functions. For example, Unix and Unix-like operating systems have the vi editor (or a variant), but many also include the Emacs editor. Microsoft Windows systems come with the simple Notepad, though many people—especially programmers—prefer another Windows text editor with more features. Under Apple Macintosh's classic Mac OS there was the native SimpleText, which was replaced under Mac OS X by TextEdit, which merges features of a text editor with those of a word processor such as rulers, margins and multiple font selection. Some editors, such as WordStar, have dual operating modes allowing them to be either a text editor or a word processor.

Text editors for professional users can edit files of arbitrary sizes, such as log files or unusually large texts, such as an entire dictionary placed in a single file. Simpler text editors may just read files into the computer's main memory. On larger files, this may be a slow process, and the entire file might not fit. Some text editors do not let the user start editing until this read-in is complete.

"Programmable editors" can be customized for specific uses. For example, Emacs can be customized by programming in Lisp. One motive for customizing is to make a text editor use the commands of another text editor with which the user is more familiar.

An important group of programmable editors uses REXX as the scripting language. These "orthodox editors" let the user open a "command line" into which commands and REXX statements can be typed. Most such editors are derivatives of XEDIT, IBM's editor for VM/CMS. Among them are THE, KEDIT, SlickEdit, X2, Uni-edit, UltraEdit, and SEDIT. Some vi derivatives such as Vim also support folding as well as macro languages, and also have a command line.

A text editor written or customized for a specific use can sense what the user is editing and assist the user, often by providing simple ways to retrieve related information. Many text editors for software developers include source code syntax highlighting and automatic completion to make programs easier to read and write. Programming editors often let the user select the name of a subprogram or variable, and then jump to its definition and back. Often an auxiliary utility like ctags is used to locate the definitions.

Typical features[edit]

Specialised editors[edit]

Some editors include special features and extra functions, for instance,

See also[edit]

Notes[edit]

External links[edit]