cdsfiui 发表于 2017-01-20 12:02

如何设置一个errorformat符合我的vim+quickfix需求?

例如,我想用我的日志文件,来"跳转"和学习代码的调用关系。我的日志格式形如:

       

这个日志格式有4个部分

1. 日期和时间戳,精确到微秒
2. 日志级别例如等
3. 当前进程的id
4. 源文件名称+代码行数

我希望vim能用quickfix来把这个文件当成编译错误文件,来跳转到指定的文件位置: 用这种方法来知道整个程序的执行流程。
gcc的错误信息如下:

test.cpp: In function ‘int main()’:
test.cpp:5: error: ‘pp’ was not declared in this scope
I wish to use VIM+quick fix to navigate my log file and jump to source files, and see how the program executes.

那么我的需求是: 在.vimrc里面set efm如何设置这个格式字符串,能让我的日志文件,可以跳转到指定的文件和位置?
谢谢。

Thanks.

cdsfiui 发表于 2017-01-22 10:25

我知道了:

let &errorformat = '[%.%#]%*[ \t][%t%*]%*[ \t][%n]%*[ \t][%f:%l]%m'
页: [1]
查看完整版本: 如何设置一个errorformat符合我的vim+quickfix需求?