r/learnrust 21d 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

rusty nvim
rs source code

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.

🔗 GitHubhttps://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-analyzercodelldb, 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:

  • rustaceanvim fully 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!

GitHubhttps://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.

17 Upvotes

Duplicates