Skip to content

Instantly share code, notes, and snippets.

@DevonMorris
Created November 19, 2020 13:42
Show Gist options
  • Save DevonMorris/aa7b2797f3ba05ef51f068bfedb49a2b to your computer and use it in GitHub Desktop.
Save DevonMorris/aa7b2797f3ba05ef51f068bfedb49a2b to your computer and use it in GitHub Desktop.
Ftplugin to use with vim dispatch and rust

With this rust.vim in nvim/after/ftplugin/rust.vim, you can just run :Make and it will make your project, populate the qf list and you can jump between errors with :cn and :cp

set makeprg=cargo\ check
set errorformat=
\%-G,
\%-Gerror:\ aborting\ %.%#,
\%-Gerror:\ Could\ not\ compile\ %.%#,
\%Eerror:\ %m,
\%Eerror[E%n]:\ %m,
\%Wwarning:\ %m,
\%Inote:\ %m,
\%C\ %#-->\ %f:%l:%c,
\%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment