![]() | |
![]() Textmate screenshot | |
Developer(s) | Allan Odgaard (MacroMates), Ciarán Walsh |
---|---|
Initial release | 5 October 2004; 20 years ago (2004-10-05) |
Final release | 2.0.23[1] ![]() |
Repository | |
Operating system | macOS |
Type | Source code editor |
License |
|
Website | macromates |
TextMate is afree and open-source general-purposeGUItext editor formacOS created by Allan Odgaard. TextMate featuresdeclarative customizations,tabs for open documents, recordablemacros,folding sections,snippets,shell integration, and an extensible bundle system.
TextMate 1.0 was released on 5 October 2004, after 5 months of development, followed by version 1.0.1 on 21 October 2004.[2][3][4] The release focused onimplementing a small feature set well, and did not have a preference window or a toolbar, didn't integrateFTP, and had no options for printing.[5][6] At first only a small number of programming languages were supported, as only a few “language bundles” had been created. Even so, 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 ofBBEdit.[7]
TextMate 1.0.2 came out on 10 December 2004. In the series of TextMate 1.1betas, 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.[8] Reviews were positive, in contrast to earlier versions that had been criticised.[9]
TextMate continued to develop through mid-2006. On 8 August 2006, TextMate was awarded theApple Design Award for Best Developer Tool, at Apple'sWorldwide Developers Conference inSan Francisco,California.[10] 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, andrevision control systems such asSubversion.[11] Throughout 2007, the core application changed only minimally, though its “language bundles” continued to advance.
In June 2009, TextMate 2 was announced as being about 90 percent complete, but with an undisclosed final-feature list.[12] A public alpha was made available for download on the TextMate blog in December 2011, followed by a release candidate at the end of 2016. In September 2019, a final version was released.[13]
In August 2012, TextMate 2'ssource code was published onGitHub under the terms ofGPL-3.0-or-later,[14] an attempt by the developer to counteract restrictions Apple placed on software distributed through theMac App Store.[15] Odgaard stated he prefers receiving patches as public domain as this preserves his ability to release a future version under a more permissive license, or to make a version available on the Mac App Store. Odgaard also stated he has a friend who uses some of TextMate's frameworks in a closed-source project, and they could not incorporate patches released under GPL.[16][17]
In October 2021, the latest/last commit was made to GitHub, though no announcement has been made to the effect that the project has been officially abandoned and its source code is still publicly available.[18]
TextMate language grammars allows users to create their own arbitrarily complexsyntax highlighting modes by assigning each document keyword a unique name.[19] It uses a modified version of the Apple ASCIIproperty list format to define language grammars.[citation needed] These grammars allow nesting rules to be defined using theOnigurumaregular expression library, and then assigned specific “scopes”: compound labels which identify them for coloration.
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 hierarchal 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.
TextMate documentation provides a list of naming commonly used across different programming languages for interoperability between bundles.[19]
TextMate supports user-defined and user-editable commands that are interpreted bybash or theinterpreter specified with ashebang. Commands can be sent many kinds of input by TextMate (the current document, selected text, the current word, etc.) in addition toenvironment 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 atool 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 orRuby contain commands for compiling and/or running the current document or project. In many cases theSTDOUT and STDERR of the code's process will be displayed in a window in TextMate.
At their simplest, TextMate “snippets” are pieces of text which can be inserted into the document at the current location via a context-sensitive key stroke or tab completion. Snippets are "intelligent", supporting "tab stops" dynamic updating, access to environment variables, and the ability to run inline scripts. This allows complicated behaviors. Tab stops can be cycled through using the “tab” key and support default text, drop-downs, to complete elements of the snippet. The results of these tab stops can be dynamically changed in another portion of the snippet, as the user fills in a stop. TextMate environment variables can be used, supporting information about the current scope, line number, or author name, etc. Snippets also have the ability to run inline shell scripts.
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 special keys such as the return key and spacebar can be overridden.
A Subversion repository is available containing many more bundles than are shipped with the editor package, for everything fromMarkdown toblogging toMIPS assembly language.[20]
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 oftabs across the top. In TextMate 1.5, this drawer provides a means for users to organize files and folders from across the file system, as well as the ability to create virtual folders for further organization. This feature was removed from TextMate 2 and replaced with an ordinaryfile browser. Search and replace can be undertaken across an entire project, and commands can interact with the selected files or folders in the drawer. Bundles forCVS, Subversion,darcs, and otherrevision control systems allow TextMate to manage versioned code.
TextMate has many features common to programming editors:
In addition, TextMate supports features to integrate well with the OS X graphical environment:
![]() | This section needs to beupdated. Please help update this article to reflect recent events or newly available information.(October 2021) |
TextMate does have a few limitations when compared to other editors in its class:
TextMate 1.5 won theApple Design Award for best developer tool in 2006.
{{cite web}}
:Missing or empty|title=
(help)TextMate developer MacroMates announced on Thursday that the code for TextMate 2.0, currently in alpha, is now available via the online GitHub repository. The code is being open sourced in order to counteract what some developers see as Apple's increasingly limiting user and developer freedom on the Mac platform.
Many open source proponents and would-be code contributors were vociferous in their opposition to Odgaard's choice of version 3 of the GNU General Public License, while asking upstream code patches to carry a public domain license. The problem, unfortunately, is the tug-of-war between FOSS principles and the desires of commercial ventures.