What options should I use for rust programming for nvim?
28d 19h ago by lemmy.world/u/ZeDoTelhado in neovim@programming.devI am very new to nvim in general, and lately I have been trying to see if I can get configured to work better for rust programming (simple stuff, like proper language highlights, automatic formatting, if not too much work have rust-analyzer to sometimes check what is being done once in a while). I tried to check online what people post about this subject, and more often than not I am lead to guides and explanations that clearly do not work with the more recent versions of nvim. And in some cases, they shove so many plugins that I lose count (and many times tried to change stuff like init.lua just to end up with a broken install).
So my questions are:
- What options can be used by nvim itself that makes it more suitable for rust development (excluding plugins)?
- If plugins must be used to have more advanced features, what are they and what are the best practices to add them to nvim?
EDIT: typos
For rust_analyzer I use nvim-lspconfig, you can also configure it by hand, but it's less work with lspconfig.
https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#rust_analyzer
And I would install the treesitter-grammar for rust. https://github.com/nvim-treesitter/nvim-treesitter
The Plugin was archived, but it still works. You can also install the treesitteer grammar with your package manager and just activate it in nvim, if you don't want to rely on an archived plugin.
That's mostly it, for what you asked for.
I also use blink for autocompletion, but I think it's a good idea to start smaller and see what you need later. https://github.com/Saghen/blink.cmp
Thanks for the tips! I will try later once I sanitize my nvim installation once again. And good thing you mentioned, auto complete does sounds like something I might eventually want
This comment is really solid. Exactly what I do, but I also have a bunch of QoL plugins. https://codeberg.org/dannyfritz/dotfiles/src/branch/master/mini
rustaceanvim is a batteries included rust-analyzer integration. i don’t do any configuration past install. the expandMacros function is one i use a lot, but it comes with a lot of extra stuff for different workflows.