I have been curious about the Rust programming language for a while now, with all the hype around its performance and safety features. Recently I joined a new team in my company that uses Rust for some of their projects, so I took the opportunity to dive into it.
The first step is of course to set up my development environment.
Environment
My Neovim LSP and DAP configurations are managed using
- mason.nvim for managing external tools
- lsp-zero.nvim for LSP configuration (I’m lazy and I like their defaults)
- nvim-dap for debugging
LSP
As the official guide book suggests, I installed Rust using rustup.
|
|
Make sure to uninstall any previous versions of Rust before installing with rustup.
rust-analyzer was the only thing I needed from mason to get LSP working for Rust.
DAP
For debugging, I installed codelldb from mason. Here is my nvim-dap configuration for Rust:
|
|
With this, I was able to start Rust debugging sessions directly from Neovim, just like with other languages.
Since I’m exclusively working with Cargo projects, I just hard-coded the cargo build command and build output path into my configs. Things might change in the future.
Conclusion
I’m happy about how little config I had to do get Rust development working in Neovim. So far it’s working great wrestling with Rustlings.

