简体   繁体   English

如何控制 Vim 快速修复中的错误 output 格式?

[英]How to control error output format in Vim quickfix?

I took this script - http://www.vim.org/scripts/script.php?script_id=891 - and modified it to show error numbers (eg not just C or R , but C0301 or R0202 ) by adding --include-ids\ y to the command line invoking pylint and changing errorformat line from I took this script - http://www.vim.org/scripts/script.php?script_id=891 - and modified it to show error numbers (eg not just C or R , but C0301 or R0202 ) by adding --include-ids\ y到命令行调用 pylint 并将 errorformat 行从

CompilerSet efm=%+P[%f],%t:\ %#%l:%m,%Z,%+IYour\ code%m,%Z,%-G%.%#

to

CompilerSet efm=%+P[%f],%t%n:\ %#%l:%m,%Z,%+IYour\ code%m,%Z,%-G%.%#  

Straightforward enough.够直截了当。 But in the error output i get C 301 instead of C0301 .但是在错误 output 我得到C 301而不是C0301 It is a minor issue, but still, i am puzzled - there seems to be no way of displaying this kind of error tags correctly.这是一个小问题,但我仍然感到困惑 - 似乎没有办法正确显示这种错误标签。 Am i missing something here?我在这里错过了什么吗?

While writing, i also noticed that it changes E error codes to error and W to warning .在写作时,我还注意到它将E错误代码更改为error并将W更改为warning How can i control output format for :clist in general?我一般如何控制:clist的 output 格式? Is it hardcoded?它是硬编码的吗?

It is not hardcoded, it can be customized using 'errorformat' option.它不是硬编码的,可以使用 'errorformat' 选项自定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM