https://github.com/raffeyang/sublimeswiftformat
Swift code formatter for Sublime Text via SwiftFormat https://github.com/nicklockwood/SwiftFormat
https://github.com/raffeyang/sublimeswiftformat
formatter sublime-text swift
Last synced: 29 days ago
JSON representation
Swift code formatter for Sublime Text via SwiftFormat https://github.com/nicklockwood/SwiftFormat
- Host: GitHub
- URL: https://github.com/raffeyang/sublimeswiftformat
- Owner: RaffeYang
- License: mit
- Created: 2016-12-10T08:06:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-30T13:16:24.000Z (over 8 years ago)
- Last Synced: 2025-04-03T00:41:24.818Z (about 1 year ago)
- Topics: formatter, sublime-text, swift
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SublimeSwiftFormat
A simple plugin to format swift code in Sublime Text.
## Prerequisites
- macOS
- Xcode
- SwiftFormat
> This package relies on the amazing [SwiftFormat](https://github.com/nicklockwood/SwiftFormat) to format Swift source code files.
> The simplest way to install the `swiftformat` command-line tool is via [Homebrew](http://brew.sh/). If you already have Homebrew installed, just type
>
> ```
> brew update
> brew install swiftformat
> ```
## Installation
#### Package Control
- [ ] Comming Soon
#### Manual
1. Navigate to the Sublime Text package directory
2. Clone the repository
```bash
git clone https://github.com/Jax0rz/SublimeSwiftFormat.git
```
## Commands
- `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
## Configuration
- `swift_format_on_save`
- Automatically format files on save
- `swift_format_binary`
- Full path to `swiftformat` binary (if not on `PATH`)
```
{
"swift_format_on_save": false,
"swift_format_binary": "/usr/local/bin/swiftformat"
}
```
## Thanks
This Plugin is heavily inspired by [RustFormat](https://github.com/Rypac/sublime-rust-format)
## License
MIT License