This is a four-space and two-space indentation interconverter. This is a preview because I still need to use it a few times and see if there are some weird cases I need to account for.
Ctrl-Shift-P
orF1
to open the command menu, then type either of the following:Two to four (indentation)
Four to two (indentation)
- If there is no active selection, twospacefourspace will act on the entire file
Example of addition to keyboard shortcuts config file (open using the File
menu or by running the Preferences: Open Keyboard Shortcuts
command):
{
"key": "ctrl+shift+=",
"command": "twospacefourspace.twoToFour",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+-",
"command": "twospacefourspace.fourToTwo",
"when": "editorTextFocus"
}
- Throw warning dialog when indentation isn't two or four spaces and can't properly convert without 'losing' whitespace
- Deal with edge cases if/when I encounter them
Now handles selection
Initial release