cargo.vim 885 B

123456789101112131415161718192021222324252627282930313233343536
  1. " Vim compiler file
  2. " Compiler: Cargo Compiler
  3. " Maintainer: Damien Radtke <damienradtke@gmail.com>
  4. " Latest Revision: 2014 Sep 24
  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. runtime compiler/rustc.vim
  10. let current_compiler = "cargo"
  11. let s:save_cpo = &cpo
  12. set cpo&vim
  13. if exists(':CompilerSet') != 2
  14. command -nargs=* CompilerSet setlocal <args>
  15. endif
  16. if exists('g:cargo_makeprg_params')
  17. execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
  18. else
  19. CompilerSet makeprg=cargo\ $*
  20. endif
  21. " Ignore general cargo progress messages
  22. CompilerSet errorformat+=
  23. \%-G%\\s%#Downloading%.%#,
  24. \%-G%\\s%#Compiling%.%#,
  25. \%-G%\\s%#Finished%.%#,
  26. \%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
  27. \%-G%\\s%#To\ learn\ more\\,%.%#
  28. let &cpo = s:save_cpo
  29. unlet s:save_cpo