Vim errorformat for Visual Studio

后端 未结 7 1237
南方客
南方客 2021-01-30 17:18

I want to use Vim\'s quickfix features with the output from Visual Studio\'s devenv build process or msbuild.

I\'ve created a batch file called build.bat which executes

相关标签:
7条回答
  • 2021-01-30 17:59

    None of these errorformats worked in Visual studio 2009 v9.0.21022.8 professional edition. Using cygwin, had to call devenv from bash which made setting makeprg a little tricky (screw batch files). Also had to tweak my errorformat when devenv splits into multiple processes and proceeds error message with "1>" or "2>" etc:

    set autowrite
    "2>c:\cygwin\home\user\proj/blah.cpp(1657) : error C2065: 'blah' : undeclared identifier
    
    set errorformat=%.%#>\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %[A-Z\ ]%#%n:\ %m
    let prg="devenv"
    let makepath=$MAKEPATH
    let &makeprg='cmd /c "'.prg.' '.makepath.'"'
    

    My .bashrc sets the MAKEPATH environment variable using cygpath to convert to a DOS compatible path:

    export MAKEPATH="$(cygpath -d "proj/VC9/some.sln") /build \"Debug\""
    

    If you have vim 6.x you can use :cw which is SO much better than clist (try searching for errors among hundreds of warnings and you know what I mean). Looking at vim tweaks makes me want to vomit but I'm in vim heaven!!! Good bye visual studio! Thanks for the base to tweak pydave +1.

    0 讨论(0)
提交回复
热议问题