TabifyIndents for Xcode
Two Xcode editor commands: turn leading spaces into tabs, or tabs into spaces.
What it does
TabifyIndents adds Tabify and Untabify to Xcode’s editor menu. Tabify replaces leading space runs with the right number of tabs; Untabify does the reverse. Both respect the indentation width configured for the file.
That is the whole app. It exists because Xcode has no built-in command for it, and a project that mandates tabs will otherwise reject a file a contributor wrote with spaces.
Notes
Like any source editor extension, it must be enabled in System Settings → Login Items & Extensions → Xcode Source Editor before the menu items appear.
Alternative to
| Alternative | Type | Trade-off |
|---|---|---|
| EditorConfig | Open source | Sets indentation per project so files never arrive wrong |
expand and unexpand | Built in | Built into macOS, scriptable over a whole tree |
| SwiftFormat or swift-format | Open source | Normalises indentation as part of formatting |
Install
TabifyIndents for Xcode on the Mac App Store
Or with mas:
mas install 1179234554