A simple plugin to format swift code in Sublime Text.
- macOS
- Xcode
- SwiftFormat
This package relies on the amazing SwiftFormat to format Swift source code files.
The simplest way to install the
swiftformatcommand-line tool is via Homebrew. If you already have Homebrew installed, just typebrew update brew install swiftformat
- Comming Soon
-
Navigate to the Sublime Text package directory
-
Clone the repository
git clone https://github.com/Jax0rz/SublimeSwiftFormat.git
SwiftFormat: Format Selection- Format the current selection
SwiftFormat: Format File(ctrl+option+f)- Format the current file
SwiftFormat: Enable Format on Save- Enable automatic formatting of swift source files on save
SwiftFormat: Disable Format on Save- Disable automatic formatting of swift source files on save
swift_format_on_save- Automatically format files on save
swift_format_binary- Full path to
swiftformatbinary (if not onPATH)
- Full path to
{
"swift_format_on_save": false,
"swift_format_binary": "/usr/local/bin/swiftformat"
}
This Plugin is heavily inspired by RustFormat
MIT License