Textmate 2 Tips

  • Archive
  • RSS
  • Submit

An excellent example of a .tm_properties file

A big thanks to hmans for sharing his .tm_properties file. Particularly useful are his instructions on how to hide specific directories (in this case: log, vendor and tmp) from the “Find File” dialog, but not from the project browser.

    • #.tm_properties
    • #Settings
    • #Preferences
    • #submission
  • 1 year ago
  • 11
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

TextMate Blog » Git Style Configuration

    • #Git
    • #Preferences
    • #.tm_properties
    • #Settings
  • 1 year ago
  • 2
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

TextMate 2 .tm_properties — Gist

More documentation of .tm_properties, showing among other things the ability to set preferences based on file type.

    • #.tm_properties
    • #preferences
    • #settings
  • 1 year ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

List of settings

A list of settings for your .tm_properties file, and some explanation, from a pastie posted by Allan Odgaard

# List of Settings

## I/O

* `binary` — If set for a file, file browser will open it with external program when double clicked. Mainly makes sense when targetting specific globs.
* `encoding` — Set to the file’s encoding. This will be used during save but is also fallback during load (when file is not UTF-8). Load encodinng heuristic is likely going to change.
* `fileType` — The file type given as scope, e.g. `text.plain`.
* `useBOM` — Used during save to add BOM (for those who insist on putting BOMs in their UTF-8 files).

## Display

* `theme` — UUID of theme, presently unused but will be back, and should allow name of theme as well (use _View → Themes_ to change theme — remember to install the Themes bundle).
* `fontName`, `fontSize` — Name and size of font, e.g. `Menlo` and `13`. Presently these two keys are required to override font, but there will be a font option in the _View_ menu, so this is only for special requirements.
* `showInvisibles` — Sets the initial value. Can also be changed via View menu.
* `softTabs`, `tabSize` — Presently can only be changed this way, but there should be some memory added to Avian.
* `spellChecking`, `spellingLanguage` — Enable/disable spelling and set language. The language is defined by Apple, I can extract a list (but depends on installed spell checkers).

## Projects

* `projectDirectory` — the project directory, generally set to `$CWD` in a `.tm_properties` file at the root of the project. This affects `TM_PROJECT_DIRECTORY` and default folder for ⇧⌘F.
* `windowTitle` — override the window title. The default is `$TM_DISPLAYNAME` but could e.g. be changed to `$TM_FIEPATH`. Should add a `$TM_SCM_BRANCH`.

## Other

* `scopeAttributes` — The value is added to the scope of the current file.

## File Filtering Keys

These are all globs and perhaps a bit arcane.

The file browser, if it has a file, checks that file against the first key with a value in this order: `excludeFilesInBrowser`, `excludeInBrowser`, `excludeFiles`, `exclude`. If neither match, it then does the same with include keys, and if one match, it is included.

The default include key is `*` (so no hidden files, although see the default `.tm_properties` which include `.htaccess` and `.tm_properties`). The default exclude key is the empty string (nothing matches).

* `exclude`
* `excludeFiles`
* `excludeDirectories`
* `excludeInBrowser`
* `excludeInFolderSearch`
* `excludeInFileChooser`
* `excludeFilesInBrowser`
* `excludeDirectoriesInBrowser`

* `include`
* `includeFiles`
* `includeDirectories`
* `includeInBrowser`
* `includeInFileChooser`
* `includeFilesInBrowser`
* `includeDirectoriesInBrowser`
* `includeFilesInFileChooser`
    • #Settings
    • #Preferences
    • #.tm_properties
  • 1 year ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Git status in file browser

If you’ve configured your .tm_properties file to point to your installation of git, the file browser will display source control status icons on your files.

You can see this on the index.php and header.php files in the repo above, both of which have not-yet-committed changes, and are displaying small blue circle icons.

    • #SCM
    • #git
    • #File browser
    • #preferences
  • 1 year ago
  • 1
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Create a .tm_properties file to set preferences

Here are a few handy rules you can put in your .tm_properties file:

TM_GIT         = "/usr/local/bin/git"
excludeFiles   = "*.{so,pyc,o,scssc}"
excludeDirectories = "build,dist,tmp,log"

# show the path to the current tab's file in the window title 
# (replace the 2 instances of 'username' in the string below 
# with your mac username).
windowTitle    = "$TM_DISPLAYNAME${TM_DIRECTORY/\A(?:\/Users\/username\w+\/?(.*)|(.+))\z/${2:? – ${2/\A\/Users\/username/~/}:${1/\A(?=.)/ – /}}/}"
fontName = "Monaco" fontSize = 13 tabSize = 2 softTabs = true wrapColumn = 80 | "Use Window Frame" # choose one sofWrap = false showInvisibles = true # special per-filetype rules can be specified like so: [ *.{txt,md,mdown,markdown} ] spellChecking = true tabSize = 4

With thanks to fonnesbeck and JEG2 who were the only hits when I Googled for “.tm_properties”.

    • #preferences
  • 1 year ago
  • 4
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
In his post announcing the alpha, Allan mentioned that not everything in the preferences menu works—and that many settings aren’t sticky. He refers to ‘.tm_properties’ as a solution to this. What you want to do is create a ‘.tm_properties’ file at ~/, as seen above. It appears that you can set any menu item here by camel casing it, but YMMV.
View Separately

In his post announcing the alpha, Allan mentioned that not everything in the preferences menu works—and that many settings aren’t sticky. He refers to ‘.tm_properties’ as a solution to this. What you want to do is create a ‘.tm_properties’ file at ~/, as seen above. It appears that you can set any menu item here by camel casing it, but YMMV.

    • #preferences
  • 1 year ago
  • 2
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Logo

Textmate 2: The missing manual. Help us out by submitting any tips or tricks you come across!

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Submit
  • Mobile

Brought to you by Ned Schwarz..

Effector Theme by Pixel Union