TextMate
Encyclopedia
TextMate is a general-purpose GUI
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

 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....

 for Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 created by Allan Odgaard. Popular with programmers, some notable features include declarative
Declarative programming
In computer science, declarative programming is a programming paradigm that expresses the logic of a computation without describing its control flow. Many languages applying this style attempt to minimize or eliminate side effects by describing what the program should accomplish, rather than...

 customizations, tabs for open documents
Tab (GUI)
In the area of graphical user interfaces , a tabbed document interface is one that allows multiple documents to be contained within a single window, using tabs as a navigational widget for switching between sets of documents...

, recordable macros, folding sections
Folding editor
A folding editor is a text editor which supports text folding or code folding, a mechanism allowing the user to hide and reveal blocks of text—usually named...

 and snippets, shell
Shell (computing)
A shell is a piece of software that provides an interface for users of an operating system which provides access to the services of a kernel. However, the term is also applied very loosely to applications and may include any software that is "built around" a particular component, such as web...

 integration, and an extensible bundle system.

History

In 2004, Allan Odgaard began the development of TextMate. TextMate 1.0 came out on 5 October 2004, after 5 months of development, followed by version 1.0.1 on 21 October 2004. The release focused on implementing a small feature set well, and did not have a preference window or a toolbar, didn’t integrate FTP
File Transfer Protocol
File Transfer Protocol is a standard network protocol used to transfer files from one host to another host over a TCP-based network, such as the Internet. FTP is built on a client-server architecture and utilizes separate control and data connections between the client and server...

, and had no options for printing. At first only a small number of programming languages were supported, as only a few “language bundles” had been created. Despite all that, some developers found this early and incomplete version of TextMate a welcome change to a market that was considered stagnated by the decade-long dominance of BBEdit
BBEdit
BBEdit is a proprietary text editor made by Bare Bones Software. It was originally developed for Macintosh System Software 6 and is now available for Mac OS X.BBEdit is marketed under the trademark slogan, "It doesn't suck."-History:...

.

TextMate 1.0.2 came out on 10 December 2004. In the series of TextMate 1.1 betas, TextMate gained features: a preferences window with a GUI for creating and editing themes; a status bar with a symbol list; menus for choosing language and tab settings, and a “bundle editor” for editing language-specific customizations. On 6 January 2006, Odgaard released TextMate 1.5, the first “stable release” since 1.0.2. Reviews were positive, and many reviewers who had previously criticised the program now endorsed it.

TextMate continued to develop through mid-2006. On 8 August 2006, TextMate was awarded the Apple Design Award for Best Developer Tool, at Apple’s Worldwide Developers Conference
Worldwide Developers Conference
The Apple Worldwide Developers Conference, commonly abbreviated WWDC, is a conference held annually in California by Apple Inc. The conference is primarily used by Apple to showcase its new software and technologies for developers, as well as offering hands-on labs and feedback sessions...

 in San Francisco, California
California
California is a state located on the West Coast of the United States. It is by far the most populous U.S. state, and the third-largest by land area...

, to “raucous applause.” In February 2006, the TextMate blog expressed intentions for future directions, including improved project management, with a plug-in system to support remote file systems such as FTP, and revision control
Revision control
Revision control, also known as version control and source control , is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may change the same files...

 systems such as Subversion. Those changes, however, have been slow to materialize. Throughout 2007, the core application changed only minimally, though its “language bundles” continued to advance.

In June 2009, TextMate 2 was announced to be in development and about 90 percent complete, but which features it will include wasn't disclosed. As of September 2011 it has yet to be released, but a public alpha has been announced as forthcoming on the TextMate blog.

Nested scopes

TextMate allows users to create their own arbitrarily complex 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...

 modes by using a modified version of the Apple ASCII property list
Property list
In the Mac OS X, iOS, NeXTSTEP, and GNUstep programming frameworks, property list files are files that store serialized objects. Property list files use the filename extension .plist, and thus are often referred to as p-list files....

 format to define language grammars. These grammars allow nesting rules to be defined using the Oniguruma
Oniguruma
by K. Kosako is a BSD licensed regular expression library that supports a variety of character encodings. The Ruby programming language, since version 1.9, as well as PHP's multi-byte string module , use Oniguruma as their regular expression engine. It is also used in products such as Tera Term,...

 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"...

 library, and then assigned specific “scopes”: compound labels which identify them for coloration.

Therefore, each point of a document is assigned one or more scopes, which define where in the document the point is, how it should be colored, and what the behavior of TextMate should be at that point. For instance, the title of one of the links in the “External links” section has the scope:


text.html.mediawiki
markup.list.mediawiki
meta.link.inline.external.mediawiki
string.other.link.title.external.mediawiki


This scope tells us that we are looking at a link title within a link within a list within a MediaWiki document.

TextMate themes can mark up any scope, at varying levels of precision. For instance, one theme may decide to color every constant (constant.*) identically, while another may decide that numerical constants (constant.numeric.*) should be colored differently than escaped characters (constant.character.escape.*). The nested scope syntax allows language authors and theme authors various levels of coverage, so that each one can choose to opt for simplicity or comprehensiveness, as desired.

Commands

TextMate supports user-defined and user-editable commands that are intepreted by bash or the interpreter
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

 specified with a shebang
Shebang (Unix)
In computing, a shebang is the character sequence consisting of the characters number sign and exclamation point , when it occurs as the first two characters on the first line of a text file...

. Commands can be sent many kinds of input by TextMate (the current document, selected text, the current word, etc.) in addition to environment variables and their output can be similarly be handled by TextMate in a variety of ways. At its most simple, a command might receive the selected text, transform it, and re-insert it into the document replacing the selection. Other commands might simply show a tool tip, create a new document for their output, or display it as a web page using TextMate's built-in HTML renderer.

Many language-specific bundles such as bash, PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

 or 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...

 contain commands for compiling and/or running the current document or project. In many cases the result (STDOUT and STDERR
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...

) of running the code will be displayed in a window in TextMate.

Snippets

At their simplest, TextMate “snippets
Snippet (programming)
Snippet is a programming term for a small region of re-usable source code, machine code or text. Ordinarily, these are formally-defined operative units to incorporate into larger programming modules...

” are pieces of text which can be inserted into the document at the current location. More complicated behaviors are possible, based on a few useful generalizations of this idea. First, snippets can include one or more “tab stops”, which can be cycled through using the “tab” key. Second, the results of these tab stops can be dynamically changed in another portion of the snippet, as the user fills in the stop. Third, the snippets have access to TextMate environment variables such as current scope, current line number, or author name, and also have the ability to run inline shell scripts.

Bundles

TextMate language grammars, snippets, macros, commands, and templates can be grouped into “bundles” of functionality. Any snippet, macro, or command can be executed by pressing a keyboard shortcut, by typing a particular word and then pressing the “tab” key (so-called “tab triggers”), or by selecting the command from a menu. Tab triggers are particularly useful; the combination of tab triggers and snippets greatly eases coding in verbose languages, or languages with commonly-typed patterns.

Snippets, macros, and commands can be limited to a particular scope, so that for instance the “close html tag” command does not work in a python script, freeing up that keyboard shortcut to be used for something else. This allows individual languages, and even individual scopes, to override built-in commands such as “Reformat Paragraph” with more specialized versions. Even common key such as the return key and spacebar can be overridden to make coding seamless.

36 bundles ship with TextMate, but a Subversion repository contains 121 bundles, for everything from Markdown
Markdown
Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML "...

 to blog
Blog
A blog is a type of website or part of a website supposed to be updated with new content from time to time. Blogs are usually maintained by an individual with regular entries of commentary, descriptions of events, or other material such as graphics or video. Entries are commonly displayed in...

ging to MIPS
MIPS architecture
MIPS is a reduced instruction set computer instruction set architecture developed by MIPS Technologies . The early MIPS architectures were 32-bit, and later versions were 64-bit...

 assembly language.

Project Management

Several documents or folders can be opened at once in a TextMate project window, which provides a drawer along its side listing file and folder names, and a series of tab
Tab (GUI)
In the area of graphical user interfaces , a tabbed document interface is one that allows multiple documents to be contained within a single window, using tabs as a navigational widget for switching between sets of documents...

s across the top. Search and replace can be undertaken across an entire project, and commands can interact with the selected files or folders in the drawer. Bundles for CVS
Concurrent Versions System
The Concurrent Versions System , also known as the Concurrent Versioning System, is a client-server free software revision control system in the field of software development. Version control system software keeps track of all work and all changes in a set of files, and allows several developers ...

, Subversion, darcs
Darcs
Darcs is a distributed revision control system created by David Roundy; it was designed to replace traditional, centralized source control systems such as CVS and Subversion...

, and other revision control
Revision control
Revision control, also known as version control and source control , is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may change the same files...

 systems allow TextMate to manage versioned code.

Other features

TextMate has several other notable features:
  • Folding code sections
    Folding editor
    A folding editor is a text editor which supports text folding or code folding, a mechanism allowing the user to hide and reveal blocks of text—usually named...

     can be used to hide areas of a document not currently being edited, for a more compact view of code structure or to avoid distraction. The sections to be folded can be selected by hand, or the structure of the document itself can be used to determine foldings.
  • Regular-expression–based search and replace speeds complicated text manipulations. TextMate uses the Oniguruma
    Oniguruma
    by K. Kosako is a BSD licensed regular expression library that supports a variety of character encodings. The Ruby programming language, since version 1.9, as well as PHP's multi-byte string module , use Oniguruma as their regular expression engine. It is also used in products such as Tera Term,...

     regular expression library developed by K. Kosako.
  • A function pop-up provides a list of sections or functions in the current document.
  • Clipboard
    Clipboard (software)
    The clipboard is a software facility that can be used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations...

     history allows users to cut many sections of text at once, and then paste them.
  • A column editing mode trivializes adding the same text to several rows of text, and is very useful for manipulating tabular data.
  • A WebKit-based HTML view window shows live updates as an HTML document is edited.

Limitations

TextMate does have a few limitations:
  • There is no support for variable-width or wide fonts, meaning that languages such as Chinese, Japanese, Korean, and others are not supported, as their characters are wider than Latin characters.
  • There is no support for right-to-left languages such as Hebrew and Arabic.
  • TextMate has no built-in support for (S)FTP. There are workarounds on the TextMate Wiki.
  • Because TextMate is not tightly coupled to a scripting language, as 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...

     is to elisp
    Emacs Lisp
    Emacs Lisp is a dialect of the Lisp programming language used by the GNU Emacs and XEmacs text editors . It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C...

    , it is impossible for users to have complete control over the behavior of some built-in commands such as those which indent sections of text or those which move columns around; however, many useful actions can be accomplished with TextMate’s macros and commands. Allan Odgaard explained his thoughts on the subject in an email to the TextMate mailing list.
  • No built-in HTML validator — because TextMate uses the W3C validator
    W3C Markup Validation Service
    The Markup Validation Service is a validator by the World Wide Web Consortium that allows Internet users to check HTML and XHTML documents for well-formed markup...

     for HTML validation, users must be online to validate HTML.
  • Despite its substantial support for macros and snippets, TextMate has no built-in support for code-hinting or guided code-completion, so text editors that support these features may prove to be a better choice when learning the syntax of a new language.
  • TextMate is not binary safe. It is explicitly text only, and does not guarantee that arbitrary binary data in a file will be preserved through a load/save cycle, regardless of whether that data is edited.
  • TextMate's editing window is inaccessible with Mac OS X VoiceOver
    VoiceOver
    VoiceOver is a screen reader built into Apple Inc.'s Mac OS X, iOS and iPod operating systems. By using VoiceOver, the user can access their Macintosh or iOS device based on spoken descriptions and, in the case of the Mac, the keyboard. The feature is designed to increase accessibility for blind...

     and MondoMouse.

Community

TextMate has a large and active community of users, dozens of whom contribute to the open-source bundle subversion repository. The TextMate wiki
Wiki
A wiki is a website that allows the creation and editing of any number of interlinked web pages via a web browser using a simplified markup language or a WYSIWYG text editor. Wikis are typically powered by wiki software and are often used collaboratively by multiple users. Examples include...

 has many hints and tips, feature suggestions, and links to external resources. The mailing list has medium traffic, but with a relatively high signal-to-noise ratio. A ticket system exists for filing bug reports and feature requests, and an IRC
Internet Relay Chat
Internet Relay Chat is a protocol for real-time Internet text messaging or synchronous conferencing. It is mainly designed for group communication in discussion forums, called channels, but also allows one-to-one communication via private message as well as chat and data transfer, including file...

 channel ([irc://irc.freenode.net/##textmate ##textmate]) is usually active.

TextMate users write code in many dozens of programming languages, and bundles have been written to support these. Most bundles are supported by primary users - for instance the 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...

 and Ruby on Rails
Ruby on Rails
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language.-History:...

 bundles are supported by core developers for these languages libraries such as David Heinemeier Hansson
David Heinemeier Hansson
David Heinemeier Hansson is a Danish programmer and the creator of the popular Ruby on Rails web development framework and the Instiki wiki...

, Rails’ creator.

Awards

TextMate 1.5 won the Apple Design Award
Apple Design Awards
The Apple Design Awards is a special event hosted by Apple Inc. at its annual Worldwide Developers Conference. The event is meant to recognize the best and most innovative Macintosh and iOS software and hardware produced by independent developers, as well as the best and most creative uses of...

 for best developer tool in 2006.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK