Programming Rust in Neovim

Just after I set up my work Go environment in Neovim I was eager to expand this experience to another language. I was wondering how much configuration it requires from me. I was really surpised how easy it turned out.

Rust Installation

I installed Rust with Rustup:

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then I run, because I faced an issue:

$ rustup update
$ rustup comonent add rust-src

As LSP server we need a Rust Analyzer. There is an installation guide, but I just download last release, made it executable and added to the $PATH

Neovim configuration

nvim_lsp.rust_analyzer.setup{
    on_attach = on_attach
}

That’s it. I just added it to my configuration from previous post.

asciicast