-
Notifications
You must be signed in to change notification settings - Fork 1.7k
This article explains how (word) “units” are setup in 2.0. This is what completion uses. For example :symbol is different than symbol, so one isn’t suggested when completing the other.
If you do not wish for punctuation to be considered part of (completion) units, then:
- Select the menu item: Bundles → Edit Bundles…
- In the column browser select: Source → Settings → Character Class: Punctuation
- In the drawer, change scope selector from
punctuation.separatortopunctuation - Press ⌘S (Save), and close bundle editor
Be aware that definition of units are also used for word movement (⌥←/⌥→) and word selection (⌃W).
When determining what constitutes a word, the characterClass setting is first consulted (see the previous FAQ item). If this doesn't apply, then the wordCharacters setting is consulted.
You can set wordCharacters by creating a new settings item in the bundle editor with the value:
{ wordCharacters = `«value»`; }
The «value» is a string of which characters should be considered word characters; these are in addition to those already defined as word characters. If you wish, you can set the scope selector to limit the scope in which the characters should be considered a word character.
This is used for completion, word movement (⌥←/⌥→) and word selection (⌃W).
There are currently two possible ways to do this (both of which use the semantic class system):
- You can use
callback.document.export, which will filter the document that’s saved to disk (but won’t update the copy inside TextMate) - The inverse is also possible:
callback.document.will-save(which will update the copy in TextMate before saving)
Here is a bundle to strip whitespace that makes use of the callback.document.will-save class.
The View menu has a setting to toggle soft wrap. (It stores the setting for the “current file type”.)
Even with soft wrap disabled, there are settings in the Source bundle to enable indented soft wrap for comments in source files. These can be disabled by unchecking the “Enable this item” checkbox in the bundle editor.
For more info see this mailing list post about indented soft wrap.
See hidden settings.
In TextMate 1.x, a return between {} was treated specially, giving you an indented caret on a blank line. This no longer works in the alpha.
This is a complicated issue, explained best in this mailing list post.
The indentation rules have been given a higher importance in TextMate 2. As a result, some language rules aren’t up-to-date with the new precedence.
For bundle authors (or anyone who wants to get their hands dirty), the guide to indentation rules is in the 1.x manual.
Of course, indentation rules make no sense in certain languages; Python’s indentation, for example, is what determines scope, rather than delimiters. For these languages, you can disable the auto correction of indentation by adding a new settings item (scoped to the language) as follows:
{ disableIndentCorrections = :true; }
If you’d rather disable it for all languages, do the same thing without giving it a scope.
Explicit project files aren’t currently supported.
When you open a folder, the folder is treated as a project. Thus, the file chooser (⌘T) and folder search (⇧⌘F) default to the folder. (See the manual for more details.)
You can customize folder settings with a .tm_properties file.
Allan’s written a couple posts in a longer thread about this:
With the directory-centered focus, this is no longer directly possible. A simple workaround, however, is simply to add symlinks to the various other directories and files.
(Note: By default, Find in Folder does not follow symlinks. See other FAQs on how to make it follow symlinks.)
In the file browser, single-clicking the icon will open the file.
If you think the click-target is too small, you can enable the single-click behavior for the text instead. Simply run the following in a terminal:
defaults write com.macromates.TextMate fileBrowserSingleClickToOpen -bool true
If you wish to select items, you must either click to the left of the text, or hold down command (⌘) when clicking the item’s text.
This is similar to how Finder treats links. There’s currently no way to have them expand inline.
For standard bundles you should install via Preferences → Bundles.
Third party bundles can be double-clicked which installs them in:
~/Library/Application Support/TextMate/Pristine Copy/Bundles
If you wish to edit the bundles and share your changes you should install (git clone) them to:
~/Library/Application Support/TextMate/Bundles
This way, TextMate won’t create delta files (which aren’t useful for sharing).
If you manually install bundles and they do not show up, your file system may lack support for fs-events. If this is the case, you will need to delete the cache and relaunch TextMate:
rm ~/Library/Caches/com.macromates.TextMate/BundlesIndex.plist
The current plan is to generalize the update mechanism through the semantic class system, so it can be used in more cases.
However, this isn’t yet implemented, and subject to change.
Can rmate be used to open directories?
No—rmate simply sends a file back and forth. Opening a folder is way more complex.
Within the Find in Folder window, there’s a drop-down menu above the results. Enable “Follow Symbolic Links” in this menu.
Note: This will not resolve aliases created with Finder.
Duplicate Line is implemented as a command. Currently, commands aren’t supported (per sé) for multiple carets.
Use this method to migrate your personally created bundles. To install other bundles, check Preferences → Bundles.
Beta versions of TextMate required you to move your personal bundles into an Avian-bundle directory. This is no longer deemed necessary, since there is no longer a reason to open TextMate 1.x.
Note:
- In the above paths, the
~character refers to your home directory (/Users/«yourname»/). - The
Libraryfolder may be hidden by default. If so, access it from the Finder’sGowhile holding down option (⌥). - The directories under
Application Supportmay not exist on your system. If they don’t, you should create them.
