I am looking for a way to force Sublime 3 to remove all spaces and tabs from any indented line that is empty in my code, either when I save the file or as I am typing.
Is there a way?
|
if (...) {
|
some code
|
}
to
|
if (...) {
|
some code
|
}
Edit - Line - Unindent (or it's keyboard shortcut). And shift + tab works as well.
If you want to remove one tab, you can click that tab to select it, then click the minus button (-) to remove it.
Changing default indentation settings The following File Type Preferences determine the indentation settings: translateTabsToSpaces: set to either 'true' or 'false'. If true, then when tab is pressed, an equivalent number of spaces will be inserted into the buffer instead. Defaults to false.
Add this to your preferences (Preferences > Settings):
"trim_trailing_white_space_on_save": true
This will remove whitespaces from the end of all lines, even empty ones, when you save the file.
Quoting the default settings file:
// Set to true to removing trailing white space on save
"trim_trailing_white_space_on_save": false,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With