Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tannerhodges/30b178dfc3f4d7cf5324f8ff3b0f4dc1 to your computer and use it in GitHub Desktop.
Save tannerhodges/30b178dfc3f4d7cf5324f8ff3b0f4dc1 to your computer and use it in GitHub Desktop.
Convert 4 spaces to 2 spaces, Sublime Text macro
//
// Converts code indentation from 4 spaces to 2 spaces
//
// For a hotkey, add to Preferences > Key Bindings - User:
//
// { "keys": ["ctrl+alt+i"], "command": "run_macro_file", "args": {"file": "res://Packages/User/ConvertTwoSpacesToFour.sublime-macro"} }
//
[
{
"args": { "setting": "tab_size", "value": 4 },
"command": "set_setting"
},
{
"args": { "set_translate_tabs": true },
"command": "unexpand_tabs"
},
{
"args": { "setting": "tab_size", "value": 2 },
"command": "set_setting"
},
{
"args": { "set_translate_tabs": true },
"command": "expand_tabs"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment