ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Swift Format

by aerobounce ST3 MacLinux

Swift Formatter / Syntax Checker for Sublime Text 3

Details

Installs

  • Total 345
  • Win 0
  • Mac 310
  • Linux 35
Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 1 1 4 0 2 3 6 3 4 1 0 2 1 2 6 3 3 0 1 2 1 1 7 1 0 3 1 5 0 2 4 0 3 1 1 1 0 6 0 1 2 4 1 9 1 3
Linux 0 2 0 1 0 0 0 0 1 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0

Readme

Source
raw.​githubusercontent.​com

⚡️ Swift Format

Swift Formatter / Syntax Checker for Sublime Text 3

⚡️Blazingly Fast Formatting
❗️User Friendly Syntax Error Indication

📜 Overview

📦 Install

Manual Install

  1. Clone this repository as shown below (Note that target directory name has to be Swift Format)
  2. You're ready (Restart Sublime Text if the package is not recognized)
cd "$HOME/Library/Application Support/Sublime Text 3/Packages"
git clone https://github.com/aerobounce/Sublime-Swift-Format.git "Swift Format"

⚠️ Dependency

  • Swift Format does not work without swiftformat as this package utilizes the formatter.
  • (macOS users) If your default shell have the PATH to swiftformat you can start using this plugin.
  • If that is not the case, specify the Absolute PATH in the settings:
{
    "swiftformat_bin_path": "PATH to swiftformat"
}

📝 Available Commands

Caption Command Default Key Bindings
Swift Format: Format swift_format None
Swift Format: Format Selection swift_format_selection None
  • Command is the name of the command you can use for Key-Bindings.
  • Be aware that any manual modifications with Format Selection might be lost upon saving a file if format_on_save is true, which it is by default.

🛠 Default Settings

  • By default, swiftversion is not specified. It's recommended to specify the version. Unless it's specified, some rules will be omitted.
{
    /*
        Swift Format Settings
    */
    "swiftformat_bin_path": "swiftformat",
    "format_on_save": true,         // Invoke "Swift Format: Format" command on save
    "format_selection_only": false, // Entire file will be used if no selection available
    "scroll_to_error_point": true,  // Scroll to the point syntax error occured

    /*
        SwiftFormat CLI Options
            • To use only specific rules, use `rules` key.
            • To disable specific rules, use `disable` key.
            • To see up-to-date rules: `swiftformat --rules`
    */
    "swiftversion": "", // The version of Swift used in the files being formatted
    "rules": "",        // The list of rules to apply.
    "disable": "",      // A list of format rules to be disabled (comma-delimited)

    /*
        Formatting Options
            • Specify without doubled hyphens
            • To see up-to-date options: `swiftformat --options`
            • Example:
                "options": {
                    "allman": "false",
                    "ifdef": "no-indent"
                }
    */
    "options": {
    }
}

🤝 Thank you

  • nicklockwood/SwiftFormat — Swift Format for Sublime Text is powerd by swiftformat, the best Swift formatter available.