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

Rust​Code​Formatter

by kylepink ST3 Removed

A sublime plugin to format rust code (wrapper for rust-style).

Details

Installs

  • Total 4K
  • Win 2K
  • OS X 1K
  • Linux 1K
Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 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
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
OS X 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
Linux 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

Readme

Source
raw.​githubusercontent.​com

RustCodeFormatter

RustCodeFromatter is a plugin for Sublime Text 3 which allows the formatting of rust code. This plugin is a binding for rust-style. The default key to format selected lines is ctrl+k, ctrl+f. See issues section below for limitations.

Requirements

  1. Install the Rust syntax highlighting sublime package.
  2. Clone and compile rust-style. Place the executable in your search path; or direct the plugin to use the absolute path of the executable (see below Setup -> 2).

Setup

  1. Install the RustCodeFormatter package through package control or clone this project to {sublime data}/Data/Packages/RustCodeFormatter.
  2. (Optional) To set the absolute path to your rust-style installation:
    1. Open the command pallete by pressing Ctrl+Shift+P or through the menu Tools -> Command Pallete.
    2. Enter/select Rust Code Formatter: Set Path.
    3. An input field will appear with the default content rust-style. Replace with an absolute path, ie C:\directory\rust-style.exe and press enter.
  3. (Optional) To setup custom style preferences:
    1. Open the command pallete by pressing Ctrl+Shift+P or through the menu Tools -> Command Pallete.
    2. Enter/select Rust Code Formatter: Add New Style.
    3. Select one of the opened directories listed or select Other... and insert custom directory.
  4. (Optional) To change the key binding, open menu Preferences -> Key Bindings - User and add the following, substituting with your own key preference:
[
    {
        "keys": ["ctrl+k", "ctrl+f"], "command": "rust_code_formatter_format",
        "context":
        [
            {"key": "selector", "operator": "equal", "operand": "source.rust"}
        ]
    }
]

Note: If there already exists other user key bindings, insert the key binding without replacing everything.

Issues

  • rust-style is a work in progress and still has formatting issues and bugs.