rustc.vim 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. " Vim compiler file
  2. " Compiler: Rust Compiler
  3. " Maintainer: Chris Morgan <me@chrismorgan.info>
  4. " Latest Revision: 2013 Jul 12
  5. " For bugs, patches and license go to https://github.com/rust-lang/rust.vim
  6. if exists("current_compiler")
  7. finish
  8. endif
  9. let current_compiler = "rustc"
  10. let s:cpo_save = &cpo
  11. set cpo&vim
  12. if exists(":CompilerSet") != 2
  13. command -nargs=* CompilerSet setlocal <args>
  14. endif
  15. if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
  16. CompilerSet makeprg=rustc
  17. else
  18. CompilerSet makeprg=rustc\ \%:S
  19. endif
  20. " Old errorformat (before nightly 2016/08/10)
  21. CompilerSet errorformat=
  22. \%f:%l:%c:\ %t%*[^:]:\ %m,
  23. \%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
  24. \%-G%f:%l\ %s,
  25. \%-G%*[\ ]^,
  26. \%-G%*[\ ]^%*[~],
  27. \%-G%*[\ ]...
  28. " New errorformat (after nightly 2016/08/10)
  29. CompilerSet errorformat+=
  30. \%-G,
  31. \%-Gerror:\ aborting\ %.%#,
  32. \%-Gerror:\ Could\ not\ compile\ %.%#,
  33. \%Eerror:\ %m,
  34. \%Eerror[E%n]:\ %m,
  35. \%Wwarning:\ %m,
  36. \%Inote:\ %m,
  37. \%C\ %#-->\ %f:%l:%c
  38. let &cpo = s:cpo_save
  39. unlet s:cpo_save