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 75
  • Win 0
  • Mac 67
  • Linux 8
Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 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
Mac 2 1 3 4 2 4 1 0 4 3 0 1 4 0 1 0 0 3 7 0 2 2 2 2 2 4 0 1 2 3 4 1 0 2 2 0 0 0 0 0 0 0 0 0 0
Linux 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 2 0 0 0 0 0 0 0 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.