Vim errorformat for Visual Studio

后端 未结 7 1316
南方客
南方客 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:42

    I found this question when looking for errorformat for compiling c++ in Visual Studio. The above answers don't work for me (I'm not using MSBuild either).

    I figured out this from this Vim Tip and :help errorformat:

    " filename(line) : error|warning|fatal error C0000: message
    set errorformat=\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %[A-Z\ ]%#%n:\ %m
    

    Which will give you a quickfix looking like this:

    stats.cpp|604 error 2039| 'getMedian' : is not a member of 'Stats'
    

    (with error highlighted) from

    c:\p4\main\stats.cpp(604) : error C2039: 'getMedian' : is not a member of 'Stats'
    

提交回复
热议问题