

If you edit a default item the difference will be stored in ~/Library/Application Support/TextMate/Bundles. Some of the default items may not be to your exact liking, for example the coding style in snippets may differ from yours, so you may want other tab triggers, key equivalents, or similar modifications. So in CSS typing list followed by tab will give a useful menu from where you can pick what list property needs to be inserted.

This can be used to provide a simple form of code-completion, for example in CSS the tab trigger list has been assigned to all properties that start with list.

Had the tab trigger for a method (in Ruby) instead been method or similar, it means you would have to remember “I can insert a snippet for this” before typing def, whereas with def as the tab trigger, you have to remember it before pressing the space after def (basically just pressing tab instead of space).Īs with key equivalents, entering a tab trigger and pressing tab will show a menu, when multiple items share the same tab trigger. For example in Ruby a method starts with def so creating a snippet for a Ruby method and assigning it def as tab trigger gives a natural flow, as you would write def as usual and then use tab instead of taking the normal actions. Tab triggers are also useful when they match program keywords and lead to actions (such as inserting snippets) that do what you would normally do after entering the keyword. Tab triggers are rendered in the right side of the menu item with a slightly rounded rectangle as background and the tab character (⇥) shown as a suffix to the tab trigger. It is generally a good idea to use actual words instead of abbreviations (like use list instead of lst) since the purpose is to make it easier to remember, so the tab trigger should generally be the first thing that pops into your mind in the unabbreviated form. This allows you to create much better mnemonics for your bundle items as you can literally type the thing you want to execute (e.g. In your document it is thus possible to type isoD and press tab to “expand” that to the current date.
#Textmate plugins iso#
The tab trigger for this snippet is isoD (short for ISO Date). This will remove the sequence entered and then execute the bundle item.įor example the Text bundle has a snippet which inserts the current date conforming to ISO 8601 (YYYY-MM-DD). This is a sequence of text that you enter in the document and follow it by pressing the tab key (⇥). If multiple items are given the same key equivalent then a menu will appear when that key equivalent is pressed, as shown below (all of the items in the Math bundle are bound to ⌃⇧C so a menu with each key equivalent option is displayed).Īs well as assigning a single key equivalent to a bundle item, it is possible to assign a tab trigger to the item. If you want to disassociate a key equivalent with an item, press the X shown while the key equivalent field is in recording mode. A key equivalent can be any key with optional modifiers and is configured by activating the key equivalent field and pressing the key to which the item should be bound. The easiest way to perform an action (from the keyboard) is in the form of a key equivalent. TextMate offers a few ways to do this and has a simple yet powerful system to understand the current context when evaluating which action the activation method should result in, called scope selectors, which is explained in a later chapter. Most items edited in the Bundle Editor represent actions you want to execute while editing text.

which will be explained in more detail in the following sections. If you select Bundles → Bundle Editor → Show Bundle Editor you will see the command center for customizing TextMate.įrom this window you can create and edit things like snippets, commands, language grammars, etc. Normally you do not need to care about this, as you inspect (and edit) the bundles through the bundle editor (which can be reached through the Window menu). The default bundles are located in /path/to/TextMate.app/Contents/SharedSupport/Bundles. A lot of functionality in TextMate is provided through various bundles, many of which are language specific.
