Configure vim for rust (a working conf)

I am looking for a way to configure rust-analyzer or whatever tool to turn vim as an IDE for rust.

It is more than 10 hours I am trying to find out a way to:

  • have proper highlighting, using the lsp if possible
  • have hightlight in doctests
  • have lints in doctests

I have tried "rust-analyzer" + ALE then "rust-analyzer + LanguageClient_neovim, "rust" + ALE, ... nothing is satisfactory.

So I would like to know if I can expect any docttest support inside vim (hightlighting, lints, etc...) ?

If not what is the most satisfactory / working without 10 hours of configuration attempt / with a vim package or tool decently documented. If not is there another editor with vi keybinding I should switch too?

My setup uses CoC along with fannheyward/coc-rust-analyzer which works fine.

1 Like

I can't use Coc because of security issue.

Which issue are you referring to?

I cannot install npm

Do you have lints in doctests in your configuration?

I've never thought about it, but probably not.

I want that because I have remarked I never put examples inside the documentation. The reason is that it is a pain to debug them because I have to run the code, parse the error text, fix the code, then... as I used to do a loonnng time ago for all code. This is so slow. Without lint in doc test I will not write examples, this is too much a pain for something a script (I don't want to write) could do in 0.000001s while it takes me 10s for each buggy line.

The relevant docs are here: User Manual

See also this post: Neovim and Rust :: sharksforarms

Now I have move the autoload dir to the .config/nvim and plug-vim work great...
Error: lua Vim E474 ...