DEV Community

Discussion on: Configure neovim for rust development

Collapse
 
ashoutinthevoid profile image
Full Name

Nvm. I ended up building and installing the current HEAD from source. Pretty painless (instructions are on the neovim repo), definitely more successful for me than whacking archive contents somewhere on my path. The rest seemed to more or less work.

One quick easy win: add the autocommands to an augroup, and start it with au! to avoid duplication if you source your vim config while running. Probably obvious to vim veterans, but new and super useful for me.
eg

augroup rust_config
  " delete any old autocommands
  au!
  " rustfmt on write using autoformat
  autocmd BufWrite *.rs :Autoformat
augroup END

In hindsight perhaps your target audience did not include new vim users, but some of these basics (i guess?) would be helpful for any of us considering a switch and coincidentally also working in Rust.