neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

cargo.vim (1516B)


      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 
      8 if exists('current_compiler')
      9    finish
     10 endif
     11 runtime compiler/rustc.vim
     12 let current_compiler = "cargo"
     13 
     14 " vint: -ProhibitAbbreviationOption
     15 let s:save_cpo = &cpo
     16 set cpo&vim
     17 " vint: +ProhibitAbbreviationOption
     18 
     19 if exists('g:cargo_makeprg_params')
     20    execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
     21 else
     22    CompilerSet makeprg=cargo\ $*
     23 endif
     24 
     25 augroup RustCargoQuickFixHooks
     26    autocmd!
     27    autocmd QuickFixCmdPre make call cargo#quickfix#CmdPre()
     28    autocmd QuickFixCmdPost make call cargo#quickfix#CmdPost()
     29 augroup END
     30 
     31 " Ignore general cargo progress messages
     32 CompilerSet errorformat+=
     33            \%-G%\\s%#Downloading%.%#,
     34            \%-G%\\s%#Checking%.%#,
     35            \%-G%\\s%#Compiling%.%#,
     36            \%-G%\\s%#Finished%.%#,
     37            \%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
     38            \%-G%\\s%#To\ learn\ more\\,%.%#,
     39            \%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
     40            \%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
     41            \%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
     42 
     43 " vint: -ProhibitAbbreviationOption
     44 let &cpo = s:save_cpo
     45 unlet s:save_cpo
     46 " vint: +ProhibitAbbreviationOption
     47 
     48 " vim: set et sw=4 sts=4 ts=8: