Spaces to Tabs
Convert fixed-width groups of leading indentation spaces into tabs.
How to use
- Enter text, choose a tab width from 1 to 16, and run the conversion.
Capabilities and scope
Only indentation at line starts is targeted; interior spaces inside a line are left untouched.
How it works
A multiline ^(?: {width})+ pattern matches complete leading groups and replaces them with the corresponding number of tabs.
Example
At width 4, eight leading spaces become two tabs while four interior spaces remain spaces.
Useful for
- Convert space indentation to tab indentation
Before you use it
- If leading indentation is not composed entirely of full selected-width groups, the matching behavior may leave that indentation unchanged.
Frequently asked questions
Are four spaces in the middle of a sentence converted?
No. The dedicated runner only converts leading indentation.