Skip to content

Instantly share code, notes, and snippets.

@extratone
Created October 12, 2022 05:43
Show Gist options
  • Save extratone/87d1245b5ab037eb7dd12bf17199b56a to your computer and use it in GitHub Desktop.
Save extratone/87d1245b5ab037eb7dd12bf17199b56a to your computer and use it in GitHub Desktop.
[Hidden Settings · textmate/textmate Wiki](https://github.com/textmate/textmate/wiki/Hidden-Settings)

TextMate has a few settings which are not exposed in the GUI.

You can change these with the defaults shell command. (Make sure you do this while TextMate is not running!)

  • Set a key:

      defaults write com.macromates.TextMate «key» «value»
    
  • Reset a key to its default:

      defaults delete com.macromates.TextMate «key»
    
  • Read a key’s value:

      defaults read com.macromates.TextMate «key»
    

Settings

Key Description Type
disableTypingPairs When you type an opening brace, parenthesis, quote character, or similar, TextMate will insert the closing character. boolean
disableFolderStateRestore When opening a folder TextMate will restore open tabs and file browser state from the last time you had this folder open. boolean
disableAntiAlias Disable font anti-alias. boolean
disablePersistentClipboardHistory Don’t store clipboard history in ~/Library/Application Support/TextMate/ClipboardHistory.db. boolean
disableTabAutoClose Don’t close excess tabs when the tab bar overflows. boolean
fileBrowserOpenAnimationDisabled This is for the zoom animation shown when opening items via TextMate’s file browser. boolean
alwaysFindInDocument Set this if you want ⌘F to always set the “in” pop-up to “document” (by default it searches “selection” when there is a multi-line selection. boolean
fileBrowserStyle Set this key to SourceList if you want TextMate’s file browser to use the “source list” style as seen in Finder’s sidebar. string
hideStatusBar Disable the status bar shown below the text area. boolean
fontAscentDelta Increase/decrease TextMate’s default line ascend float or integer
fontLeadingDelta Increase/decrease TextMate’s default line lead float or integer
environmentWhitelist Colon-separated list of environment variables that TextMate should pass to a child process. Items with an asterisk are treated as a glob. You can use $default for the default whitelist. Example: $default:MANPATH:*EDITOR. TextMate sets up HOME, PATH, TMPDIR, LOGNAME, and USER. If you whitelist any of these, then the variable (if set) will inherit from the parent process instead. string
lineNumberFontName Allows the use of a different font for the line number display. string
lineNumberScaleFactor Allows shrinking of the line number display, defaults to 0.8 float or integer
showFavoritesInsteadOfUntitled Show Recent Projects/Favorites window on startup and re-activation (instead of having an untitled window created), defaults to false. boolean
enableLoopFilterList In the chooser lists (fuzzy file finder, bundle item chooser, and symbol list) it is now possible to make the selection loop around, that is, move from first to last item with arrow up, etc. Defaults to false. boolean
tabItemMinWidth Minimum tab width, defaults to 120. integer
tabItemMaxWidth Maximum tab width, defaults to 250. integer
tabItemLineBreakStyle Tab truncation style, defaults to 5. Possible values:

2 = Simply clip
3 = Truncate at head of line: "...wxyz"
4 = Truncate at tail of line: "abcd..."
5 = Truncate middle of line: "ab...yz"
integer

For the integer and float keys, you must use -float or -integer when setting the value.

macOS Settings

These are settings that macOS uses to trigger some features on a per-app basis and can be used to enable or disable the feature in TextMate.

Key Description Type
NSAutomaticPeriodSubstitutionEnabled Allows using double-space to end a sentence and add a period, disabled by default. boolean

Disabling Extended Attributes

TextMate use extended attributes to store caret position, etc.

On file systems which don’t support extended attributes (most network file systems), OS X will create an auxiliary file with a dot-underscore prefix (e.g., .«_filename»).

If you don’t want these files, you can disable the use of extended attributes. This is presently controlled with the volumeSettings key. Its values are:

  1. an associative array with path prefix, and
  2. another associative array with settings for that path. (Presently, only extendedAttributes is supported.)

Example: If we wanted to disable extended attributes for files under /net/:

defaults write com.macromates.TextMate volumeSettings '{ "/net/" = { extendedAttributes = 0; }; }'

Controlling Font Smoothing

Font smoothing refers to sub-pixel anti-alias on LCD screens. Apple’s font smoothing algorithm will often make light text on dark backgrounds appear bolder than the same text on a bright background.

For this reason, TextMate disables font smoothing for dark themes on high-DPI displays (retina Mac).

You can control the behavior with:

defaults write com.macromates.TextMate fontSmoothing «value»

Here «value» can be:

  • 0: Always disabled.
  • 1: Always enabled.
  • 2: Disabled for dark themes.
  • 3: Disabled for dark themes on high-DPI displays (default).

If you wish to restore the default value (3) it’s better to run the following, rather than explicitly setting the value to 3:

defaults delete com.macromates.TextMate fontSmoothing

Keybindings

Key bindings are consulted in the following order (first file with a binding wins):

~/Library/Application Support/TextMate/KeyBindings.dict
/path/to/TextMate.app/Contents/Resources/KeyBindings.dict
~/Library/KeyBindings/DefaultKeyBinding.dict
/Library/KeyBindings/DefaultKeyBinding.dict
/System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict

If you edit any these files, you’ll need to relaunch TextMate (⌃⌘Q) for changes to take effect.

Find and extend selection

These two action methods find the next/previous occurrence of the Find clipboard’s contents and selects it, while preserving the existing selection:

findNextAndModifySelection:
findPreviousAndModifySelection:

One could, for example, add this to the key bindings:

"@d" = ( "copySelectionToFindPboard:", "findNextAndModifySelection:" );

Indent-aware movement

If you want ⌘⇠, ⇧⌘⇠, ⌘⇢, ⇧⌘⇢, ⌘⌫, and ⌘⌦ to ignore leading indentation, add the following to your key bindings file:

"@\UF702"  = "moveToBeginningOfIndentedLine:";
"$@\UF702" = "moveToBeginningOfIndentedLineAndModifySelection:";
"@\UF703"  = "moveToEndOfIndentedLine:";
"$@\UF703" = "moveToEndOfIndentedLineAndModifySelection:";
"@\U007F"  = "deleteToBeginningOfIndentedLine:";
"@\UF728"  = "deleteToEndOfIndentedLine:";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment