在 Vim 中用 ALE 打印 lint 排除

Print lint rule out with ALE in Vim

目前我的 vimrc 中有以下内容以在屏幕底部显示 linter 错误消息:

let g:ale_echo_msg_format = '%linter% says: %s'

如何自定义它以便获得 lint 规则的名称(而不仅仅是描述)。

您要找的是%code%。参见 :help g:ale_echo_msg_format。您可以在 code 之前或之后放置任何您想要的字符,如果没有错误代码,该部分消息将被删除。该选项的默认值为 '%code: %%s'.