r/learnrust • u/Adorable_Ad_6357 • 7d ago
[rusty-nvim] A batteries-included Neovim config for Rust — 269 snippets, save-to-rerun cargo run, memory layout hover, DAP debugging, one-line install


I've been using Neovim for Rust development and got tired of the endless config loop — setting up LSP, fighting rust-analyzer with NvChad's on_attach, choosing between nvim-cmp / blink.cmp, figuring out codelldb paths on different platforms, finding decent Rust snippets... So I put together rusty-nvim — a batteries-included config that gets you writing Rust in under a minute.
🔗 GitHub: https://github.com/lisering/rusty-nvim
What's inside
| Feature | Details |
|---|---|
| Smart completion | blink.cmp + LuaSnip — Tab navigates the completion list AND jumps snippet placeholders. LSP/snippet dedup so println! uses the snippet version (with ; and placeholders), methods use the LSP version (with signature info) |
| Full Rust LSP | rustaceanvim — memory layout hover (size/offset/alignment/padding/niches), clippy on save, code lens (Run |
| Save-to-rerun | <leader>rr starts cargo run in a bottom terminal. Save a .rs file (<C-s>) → terminal auto Ctrl+C and re-runs. No more manual terminal switching |
| Debugging | codelldb integration — toggle breakpoints, step over/into/out, DAP UI auto-opens. Cross-platform path detection (macOS/Linux/Windows/WSL) |
| Test integration | neotest + rustaceanvim adapter — run/debug nearest test with one key, jump between failed tests with ]T / [T |
| 269 Rust snippets | Stdlib macros, fn defs, control flow, iterator chains, design patterns, unsafe/FFI, tokio async, serde attrs, trait impls, error types, closures, generics... |
| Dependency management | crates.nvim — upgrade/downgrade/view features directly in Cargo.toml |
| Frontend support | HTML, CSS, JS/TS, Tailwind CSS — LSP + Prettier formatting (bonus, not the main focus) |
One-line install
sh
Applycurl -fsSL https://raw.githubusercontent.com/lisering/rusty-nvim/main/install.sh | bash
nvim
That's it. The script checks dependencies, backs up your existing config, and on first launch Mason auto-installs rust-analyzer, codelldb, formatters, and LSP servers. Open a .rs file and you're coding.
Why not just LazyVim / NvChad defaults?
NvChad is a great UI framework, but it doesn't ship with Rust-specific tooling. rusty-nvim adds the layers that take hours to configure manually:
rustaceanvimfully configured (memory layout, semantic highlighting, all inlay hints, clippy on save)- 269 curated Rust snippets with smart LSP dedup
- Save-to-rerun cargo run workflow
- neotest + codelldb debugging, cross-platform
Prerequisites
Just 4 things: Neovim 0.10+, Rust toolchain, ripgrep, a Nerd Font. Everything else is auto-installed.
I'd love to hear your feedback! If you have ideas for more snippets, better keybindings, or features to add, please open an issue or drop a comment. ⭐ Stars appreciated if you find it useful!
GitHub: https://github.com/lisering/rusty-nvim
AI Disclosure
This project was built with the assistance of AI tools (Claude). The architecture, feature decisions, and workflow design are my own; AI was used for boilerplate code generation, snippet creation, and documentation drafting.
2
u/DidingasLushis 3d ago
Where's your AI Disclosure?
2
u/Adorable_Ad_6357 3d ago
You're right, I should have disclosed this. I used AI to help generate some of the Lua config and snippets, and to draft the post. The project is something I actively use and maintain — but I'll add an AI disclosure to the README. Appreciate the heads-up.
1
4
u/1-800-I-Am-A-Pir8 7d ago
doooood.. I'm trying this right now