簡體   English   中英

VIM:如何在我指定的錯誤消息格式中設置“errorformat”?

[英]VIM: how to set “errorformat” in my specified error message format?

在我的系統中,我們將所有構建錯誤消息重新格式化為具有以下格式:

[2016-02-10 13:17:56.885597]    [WARNING]   [53171] [src/root/mylinux/test01.cpp:300]

如您所見,此格式包含幾個部分:

1. The time stamp, day+hour+minute+second+microsecond
2. Some spaces and the [WARNING] or [ERROR] or [INFO] or [DEBUG], etc.
3. A process ID number like [53171]
4. The source file name + line number

我希望使用vim + quickfix打開此構建錯誤文件,並導航到源文件+行號。 那么如何在我的.vimrc中設置'errorformat'字符串?

非常感謝。

使用errorformat進行解析確實是一件相對不愉快的事情,但是如果你堅持的話,你可以這樣做。 一種可能的方法:

let &errorformat = '[%m]%*[ ][%t%*[A-Z]]%*[ ][%n]%*[ ][%f:%l]'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM