cargo.vim 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. " Vim compiler file
  2. " Compiler: Cargo Compiler
  3. " Maintainer: Damien Radtke <damienradtke@gmail.com>
  4. " Latest Revision: 2023-09-11
  5. " 2024 Apr 05 by The Vim Project (removed :CompilerSet definition)
  6. " For bugs, patches and license go to https://github.com/rust-lang/rust.vim
  7. if exists('current_compiler')
  8. finish
  9. endif
  10. runtime compiler/rustc.vim
  11. let current_compiler = "cargo"
  12. " vint: -ProhibitAbbreviationOption
  13. let s:save_cpo = &cpo
  14. set cpo&vim
  15. " vint: +ProhibitAbbreviationOption
  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. augroup RustCargoQuickFixHooks
  22. autocmd!
  23. autocmd QuickFixCmdPre make call cargo#quickfix#CmdPre()
  24. autocmd QuickFixCmdPost make call cargo#quickfix#CmdPost()
  25. augroup END
  26. " Ignore general cargo progress messages
  27. CompilerSet errorformat+=
  28. \%-G%\\s%#Downloading%.%#,
  29. \%-G%\\s%#Checking%.%#,
  30. \%-G%\\s%#Compiling%.%#,
  31. \%-G%\\s%#Finished%.%#,
  32. \%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
  33. \%-G%\\s%#To\ learn\ more\\,%.%#,
  34. \%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
  35. \%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
  36. \%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
  37. " vint: -ProhibitAbbreviationOption
  38. let &cpo = s:save_cpo
  39. unlet s:save_cpo
  40. " vint: +ProhibitAbbreviationOption
  41. " vim: set et sw=4 sts=4 ts=8: