Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.6 KB

intellij.md

File metadata and controls

26 lines (17 loc) · 1.6 KB

Running Rustfmt from IntelliJ or CLion

Installation

  • Install CLion, IntelliJ Ultimate or CE through the direct download link or using the JetBrains Toolbox. CLion provides a built-in debugger interface but its not free like IntelliJ CE - which does not provide the debugger interface. (IntelliJ seems to lack the toolchain for that, see this discussion intellij-rust/issues/535)

  • Install the Rust Plugin by navigating to File -> Settings -> Plugins and press "Install JetBrains Plugin" plugins

  • Press "Install" on the rust plugin install rust

  • Restart CLion/IntelliJ

Configuration

  • Open the settings window (File -> Settings) and search for "reformat" keymap

  • Right-click on "Reformat File with Rustfmt" and assign a keyboard shortcut

    shortcut_window

  • Press "OK" shortcut_after

  • Done. You can now use rustfmt in an opened *.rs file with your previously specified shortcut