Skip to content

Instantly share code, notes, and snippets.

@devoto13
Last active October 27, 2016 16:37
Show Gist options
  • Save devoto13/c52a44ce566d16010c27bea571c373b3 to your computer and use it in GitHub Desktop.
Save devoto13/c52a44ce566d16010c27bea571c373b3 to your computer and use it in GitHub Desktop.
Fixed indentation preferences for TypeScript
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>TypeScript Indent</string>
<key>scope</key>
<string>source.ts, source.tsx</string>
<key>settings</key>
<dict>
<key>bracketIndentNextLinePattern</key>
<string>(?x)
^ \s* \b(if|while|else)\b [^;]* $
| ^ \s* \b(for)\b .* $
</string>
<key>decreaseIndentPattern</key>
<string>^(.*\*\/)?\s*(\]|\}).*|\s*\).*$</string>
<key>increaseIndentPattern</key>
<string>^.*[\{\[][^\}\]"']*$</string>
<key>unIndentedLinePattern</key>
<string>^\s*(\/\/| \*|\/\*| \*\/).*$</string>
</dict>
<key>uuid</key>
<string>77966fa8-af34-4f1e-8535-e556d5063853</string>
</dict>
</plist>
@devoto13
Copy link
Author

Use following command to open file:

Cmd+Shift+P

PackageResourceViewer: OpenResource -> TypeScript -> TypeScript Indent.tmPreferences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment