Git Product home page Git Product logo

rustcodeformatter's Introduction

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.

rustcodeformatter's People

Contributors

kylepink avatar sp0 avatar

Stargazers

Uriel Scott avatar Anachron avatar Arthur Vasconcelos avatar Buger avatar Ashot Muradian avatar  avatar  avatar Haiwei Liu avatar Edward Xie avatar  avatar  avatar

Watchers

Buger avatar Edward Xie avatar  avatar  avatar

Forkers

varding

rustcodeformatter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.