VILE
Encyclopedia
vile is a text editor
Text editor
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....

 that attempts to combine the best aspects of the popular Emacs
Emacs
Emacs is a class of text editors, usually characterized by their extensibility. GNU Emacs has over 1,000 commands. It also allows the user to combine these commands into macros to automate work.Development began in the mid-1970s and continues actively...

 and vi
Vi
vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.The original code for vi...

 editors. These editors are traditionally located on opposing sides of the editor wars, as users of Emacs and vi tend to have strong sentiments against the editor they do not use; however, vile at least attempts to reconcile these positions.

vile is an acronym which stands for "VI Like Emacs". vile is featured in Chapter 12 of the O'Reilly book "Learning the vi Editor".
The program is also known as xvile for the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

, and as winvile for Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

.

vile was created and originally maintained by Paul Fox. In 1996, maintenance was taken over by Thomas Dickey, who had provided many major contributions to the codebase over the preceding years.

Learning to use vile

Historically, vile's documentation
Documentation
Documentation is a term used in several different ways. Generally, documentation refers to the process of providing evidence.Modules of Documentation are Helpful...

 has focused on differences from vi. This is in contrast to the other common vi-clones (elvis
Elvis (text editor)
Elvis is a powerful vi/ex clone, i.e. it resembles the Unix text editor "vi" very much but adds quite a few commands and features. Elvis is written by Steve Kirkendall and is distributed under the Clarified Artistic License which is used by Perl....

, nvi
Nvi
nvi is a re-implementation of the classic Berkeley text editor, ex/vi, traditionally distributed with BSD, and later, Unix systems. It was originally distributed as part of the Fourth Berkeley Software Distribution ....

 and vim
Vim (text editor)
Vim is a text editor written by Bram Moolenaar and first released publicly in 1991. Based on the vi editor common to Unix-like systems, Vim is designed for use both from a command line interface and as a standalone application in a graphical user interface...

), which have combined their respective extensions with the original vi documentation.

vile's documentation is three parts:
  • the online help file (type :h)
  • specialized topics such as the macro language (text files)
  • built-in documentation.
    • tables of commands and other data
    • dynamic windows showing register contents, mode-settings, etc.


vile is built from a combination of hand-crafted code and tables processed by a special-purpose program. The predefined information from the tables can be rendered in various ways, including showing the available commands
Command (computing)
In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell....

, providing name-completion, etc. In other flavors of vi, the analogous tables are not distinct from the hand-crafted code.

In other vi flavors, the information shown is static, requiring interaction from the user to make it update. In vile, however, this information is dynamic—it updates these special windows as changes are made to the features they render, e.g., the list of all buffers in memory, the mode-settings corresponding to the buffer which has focus, etc.

While many (not all) of vile's features are now found in other vi-compatible editors, some of the most powerful were implemented before widespread adoption in the others.
For example, multiple windows were early features in vile (and xvi) from the start. The same applies to reading from pipes, complex fences. Some of this is brought out in the O'Reilly book, though no careful study has been made of the way in which features are adopted and adapted across the vi and emacs variants.

Features and improvements over vi

  • Multi-window/multi-buffer editing
  • Multi-level undo/redo
    Undo
    Undo is a command in many computer programs. It erases the last change done to the document reverting it to an older state. In some more advanced programs such as graphic processing, undo will negate the last command done to the file being edited....

  • Multi-platform with native features rather than in a Unix
    Unix
    Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

    -compatible environment
  • Reads a buffer from standard input
    Standard streams
    In Unix and Unix-like operating systems , as well as certain programming language interfaces, the standard streams are preconnected input and output channels between a computer program and its environment when it begins execution...

     or from piped
    Pipeline (Unix)
    In Unix-like computer operating systems , a pipeline is the original software pipeline: a set of processes chained by their standard streams, so that the output of each process feeds directly as input to the next one. Each connection is implemented by an anonymous pipe...

     external commands
  • Error-expression parsing jumps to the line producing compile-errors, grep
    Grep
    grep is a command-line text-search utility originally written for Unix. The name comes from the ed command g/re/p...

     matches, etc.
  • Dynamic window updates
  • Scripting language
    Scripting language
    A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

  • Many mode settings, globally, per-buffer, per-window
  • Color-syntax highlighting
    Syntax highlighting
    Syntax highlighting is a feature of some text editors that display text—especially source code—in different colors and fonts according to the category of terms. This feature eases writing in a structured language such as a programming language or a markup language as both structures and...

     for each majormode (88 as of version 9.7).
  • Command-completion
    Command line completion
    Command line completion is a common feature of command line interpreters, in which the program automatically fills in partially typed commands....

  • Selection-highlighting using keyboard or mouse.
  • Complex fence feature enables the user to step through if/then/else statements
  • Extended regular expression
    Regular expression
    In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...

    s using both POSIX
    POSIX
    POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...

     and Perl
    Perl
    Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

     features.

Differences from vi

  • No real ex
    Ex (text editor)
    ex, short for EXtended, is a line editor for Unix systems.The original ex was an advanced version of the standard Unix editor ed, included in the Berkeley Software Distribution...

     mode, though most ex commands are recognized
  • Command-completion and underlying long command-names make it impossibile to be 100% vi-compatible.

Command completion

vile supports command completion for several elements of a command: the command-name, file-name, directory-name, and mode values.

Major modes

Both vi and emacs have modes
Mode (computer interface)
In user interface design, a mode is a distinct setting within a computer program or any physical machine interface, in which the same user input will produce perceived different results than it would in other settings....

, which are settings which affect the behavior of the program. vile extends the vi
Vi
vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.The original code for vi...

 modes such as list, number, etc., by providing three levels of mode: global, buffer and window. The buffer modes are associated with the buffer contents, e.g., line-terminators, read-only attributes. All of those modes are predefined. vile can be customized by defining majormodes, which combine specific settings of the buffer modes with an association to the file type. These majormodes have as well special modes such as the association with a specific syntax filter.

Syntax highlighting

vile performs syntax highlighting by running a syntax filter program which parses the buffer contents. Initially this was a separate program. However, to improve performance and avoid display problems, these syntax filters usually are compiled into the editor. Most of the syntax filters are implemented with lex
Lex programming tool
Lex is a computer program that generates lexical analyzers . Lex is commonly used with the yacc parser generator. Lex, originally written by Mike Lesk and Eric Schmidt, is the standard lexical analyzer generator on many Unix systems, and a tool exhibiting its behavior is specified as part of the...

 (preferably flex
Flex lexical analyser
flex is a free software alternative to lex. It is frequently used with the free Bison parser generator. Unlike Bison, flex is not part of the GNU Project. Flex was written in C by Vern Paxson around 1987...

), with the remainder in C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 to address irregular grammars such as Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

 and Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...

. All of the syntax filters follow the same design:
  • read from an external file the color- and video-attribute information into a chained hash table
    Hash table
    In computer science, a hash table or hash map is a data structure that uses a hash function to map identifying values, known as keys , to their associated values . Thus, a hash table implements an associative array...

    ,
  • parse the file according to the lexical rule
    Lexical rule
    A lexical rule is in a form of syntactic rule used within many theories of natural language syntax. These rules alter the argument structures of lexical items in order to alter their combinatory properties....

    s,
  • find the corresponding color- and video-attribute information for each lexical element, and
  • write a marked-up
    Markup language
    A markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...

     copy of the file which is read by vile (via a pipe if the syntax filters are external programs, or via a function call if they are internal).


vile paints the markup information on top of the buffer contents using in regions delimited by line and column numbers. The markup is not attached to the underlying buffer contents. To update the markup as the buffer is changed requires reanalysis. This is done automatically when the user pauses.

History

vile has been under continuous development since 1990. Some highlights:
  • 1990 port to MS-DOS
    DOS
    DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

  • 1991 first posting to alt.sources ("version three")
  • 1991 xvile, an X11 client
  • 1992 Step through C-preprocessor #if/.../#endif statements.
  • 1993 port to OpenVMS
    OpenVMS
    OpenVMS , previously known as VAX-11/VMS, VAX/VMS or VMS, is a computer server operating system that runs on VAX, Alpha and Itanium-based families of computers. Contrary to what its name suggests, OpenVMS is not open source software; however, the source listings are available for purchase...

  • 1994
    • using autoconf
      Autoconf
      GNU Autoconf is a tool for producing configure scripts for building, installing and packaging software on computer systems where a Bourne shell is available....

       to port to Unix platforms
    • port to Microsoft Windows
      Microsoft Windows
      Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

       console
    • port to OS/2
      OS/2
      OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

  • 1995
    • C syntax highlighting using video attributes attached to buffer
  • 1996
    • convert to ANSI C
  • 1997 Perl
    Perl
    Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

     interface
  • 1998
    • winvile, a Windows GUI client
    • majormodes combine buffer attributes based on file type
  • 1999
    • port to BeOS
      BeOS
      BeOS is an operating system for personal computers which began development by Be Inc. in 1991. It was first written to run on BeBox hardware. BeOS was optimized for digital media work and was written to take advantage of modern hardware facilities such as symmetric multiprocessing by utilizing...

    • combine majormodes and syntax highlighting for more than 30 languages
    • relicense as GPLv2
  • 2000 Syntax filters can be built-in or external
  • 2001
    • port to QNX
      QNX
      QNX is a commercial Unix-like real-time operating system, aimed primarily at the embedded systems market. The product was originally developed by Canadian company, QNX Software Systems, which was later acquired by Canadian BlackBerry-producer Research In Motion.-Description:As a microkernel-based...

    • Error-stepping generalized.
  • 2002 Character-classes in regular expressions
  • 2003 Minibuffer (prompt-line) generalized as one-line editor
  • 2004 Locale
    Locale
    In computing, locale is a set of parameters that defines the user's language, country and any special variant preferences that the user wants to see in their user interface...

     support
  • 2005 Syntax filters can be dynamically loaded
  • 2006 Multiple scripts can be invoked via the command-line options
  • 2007 Basic Unicode
    Unicode
    Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...

    support.

Further reading


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK