- Text editor
A text editor is a type of program used for editing plain
text file s.Text editors are often provided with
operating system s or software development packages, and can be used to changeconfiguration file s andprogramming language source code .Plain text files vs. word processor files
There are important differences between plain text files created by a text editor, and
document files created byword processor s such asMicrosoft Word ,WordPerfect , orOpenOffice.org . Briefly:*A plain text file is represented and edited by showing all the characters as they are present in the file. The only characters usable for 'mark-up' are the
control character s of the usedcharacter set ; in practice this is newline, tab and formfeed. The most commonly used character set isASCII , especially recently, as plain text files are more used for programming and configuration and less frequently used for documentation than in the past.
*Documents created by a word processor generally contain fileformat-specific "control character s" beyond what is defined in the character set. These enable functions like bold, italic, fonts, columns, tables, etc. These and other common page formatting symbols were once associated only withdesktop publishing but are now commonplace in the simplest word processor.
*Word processors can usually edit a plain text file and save in the plain text file format. However one must take care to tell the program that this is what is wanted. This is especially important in cases such as source code, HTML, and configuration and control files. Otherwise the file will contain those "special characters" unique to the word processor's file format and will not be handled correctly by the utility the files were intended for.History
Before text editors existed, computer text was punched into
Hollerith card s withkeypunch machines. The text was carried as a physical box of these thin cardboard cards, and read into a card-reader.The first text editors were line editors oriented on
typewriter style terminals and they did not provide a window or screen-oriented display. They usually had very short commands (to minimize typing) that reproduced the current line. Among them were a command to print a selected section(s) of the file on the typewriter (or printer) in case of necessity. An "edit cursor", an imaginary insertion point, could be moved by special commands that operated with line numbers of specific text strings (context). Later, the context strings were extended toregular expression s. To see the changes, the file needed to be printed on the printer. These "line-based text editors" were considered revolutionary improvements over keypunch machines. In case typewriter-based terminals were not available, they were adapted to keypunch equipment. In this case the user needed to punch the commands into the separate deck of cards and feed them into the computer in order to edit the file.When
computer terminal s with video screens became available, screen-based text editors became common. One of the earliest "full screen" editors was O26 - which was written for the operator console of theCDC 6000 series machines in 1967. Another early full screen editor isvi . Written in the 1970s, vi is still a standard editor forUnix andLinux operating 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
Some text editors are small and simple, while others offer a broad and complex range of functionality. For example,
Unix and Unix-like operating systems have thevi editor (or a variant), but many also include theEmacs editor.Microsoft Windows systems come with the very simpleNotepad , though many people—especially programmers—prefer to use one of many other with more features. UnderApple Macintosh 's classicMac OS there was the nativeSimpleText , which was replaced byTextEdit . Some editors, such asWordStar , have dual operating modes allowing them to be either a text editor or a word processor.Text editors geared for professional computer users place no limit on the size of the file being opened. In particular, they start quickly even when editing large files, and are capable of editing files that are too large to fit the computer's main memory. Simpler text editors often just read files into an array in RAM. On larger files this is a slow process, and very large files often do not fit.
The ability to read and write very large files is needed by many professional computer users. For example, system administrators may need to read long log files. Programmers may need to change large
source code files, or examine unusually large texts, such as an entire dictionary placed in a single file.Some text editors include specialized computer languages to customize the editor (programmable editors). For example, Emacs can be customized by programming in Lisp. These usually permit the editor to simulate the keystroke combinations and features of other editors, so that users do not have to learn the native command combinations.
Another important group of programmable editors use
REXX as their scripting language. These editors permit entering both commands and REXX statements directly in the command line at the bottom of the screen (can be hidden and activated by a keystroke). These editors are usually referred to as "orthodox editors", and most representatives of this class are derivatives ofXedit , IBM's editor forVM/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 have a command line at the bottom for entering commands. They can be considered another branch of the family of orthodox editors.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 permit one to select the name of a subprogram or variable, and then jump to its definition and back. Often an auxiliary utility likectags is used to locate the definitions.Some editors include special features and extra functions, for instance,
*
Source code editor s are text editors with additional functionality to facilitate the production of source code. These often feature user-programmable syntax highlighting, and coding tools or keyboard macros similar to an HTML editor (see below).
*Folding editor s. This subclass includes so-called "orthodox editors" that are derivatives of Xedit. The specialized version of folding is usually called outlining (see below).
*IDEs (integrated development environments) are designed to manage and streamline larger programming projects. They are usually only used for programming as they contain many features unnecessary for simple text editing.
*World Wide Web programmers are offered a variety of text editors dedicated to the task ofweb development . These create the plain text files that deliver web pages.HTML editor s include:Dreamweaver ,E (text editor) ,Frontpage ,HotDog ,Homesite ,Nvu ,Tidy ,GoLive , andBBedit . Many offer the option of viewing a work in progress on a built-in web browser.
*Outliner s. Folding (see above) can generally be considered a generalized form of outlining.Typical features of text editors
The process of searching for a word or string in a text file and optionally replacing the search string with a replacement string. Different methods are employed, Global(ly) Search And Replace, Conditional Search and Replace, Unconditional Search and Replace.
Cut, copy, and paste Most text editors provide methods to duplicate and move text within the file, or between files.
Text formatting Text editors often provide basic formatting features like
line wrap ,auto-indentation ,bullet list formatting, comment formatting, and so on.As with word processors, text editors will provide a way to undo and redo the last edit. Often—especially with older text editors—there is only one level of edit history remembered and successively issuing the undo command will only "toggle" the last change. Modern or more complex editors usually provide a multiple level history such that issuing the undo command repeatedly will revert the document to successively older edits. A separate redo command will cycle the edits "forward" toward the most recent changes. The number of changes remembered depends upon the editor and is often configurable by the user.
Reading or merging the contents of another text file into the file currently being edited. Some text editors provide a way to insert the output of a command issued to the operating system's shell.
Some advanced text editors allow you to send all or sections of the file being edited to another utility and read the result back into the file in place of the lines being "filtered". This, for example, is useful for sorting a series of lines alphabetically or numerically, doing mathematical computations, and so on.
ee also
*
Editor war
*List of text editors
*Comparison of text editors
*Collaborative editor
*File viewer - does not change file, faster for very large files
*Hex editor - used for editing binary filesExternal links
* [http://TextEditors.org The text editor wiki]
* [http://sourceforge.net/softwaremap/trove_list.php?form_cat=63 Text Editors at sourceforge.net]
* [http://www.softpanorama.org/Editors/index.shtml Orthodox Editors as a Special Class of Advanced Editors] Discusses Xedit and its clones with an emphasis of folding capabilities and programmability.
Wikimedia Foundation. 2010.