How to Decrease TAB Size in Sublime Text 3

1

Edit HTML files with CSS and JS using Sublime Text 3. To reindent in Sublime Text 3, I use shortcut ctrl + shift + r when I paste a code out. What is the best practice to automate the TAB key by decreasing tabs from 4 spaces to 2, for example?

    
asked by anonymous 14.08.2018 / 16:19

1 answer

1

To set the default, go to Preferences -> Settings - Default/User and use the following setting:

{
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "detect_indentation": false
}

Edit: After setting Preferences -> Settings - Default/User , select all text go in Edit -> Line -> Reindent

If you want to add a shortcut to this action go to Preferences → Keybindings and add

[
    { "keys": ["f12"], "command": "reindent", "args": {"single_line": false}}
]

Then just select the whole text and press F12 .

    
14.08.2018 / 16:36