Flycheck - *永久*禁用 Clang 作为检查器

Flycheck - disabling Clang as a checker *permanently*

我使用 Flycheck 检查 C 文件,并为 GCC 设置了相当精细的变量以使其正常工作。然而,由于我的系统上有 Clang(出于与代码无关的原因),Flycheck 总是假设这是我想要使用的,迫使我一直手动切换检查器。

我试图寻找一种方法来永久禁用 Clang 作为检查器,但我一无所获。帮助将不胜感激。

您应该可以将 c/c++-clang 添加到变量 flycheck-disabled-checkers。来自这个变量的文档(C-h v flycheck-disabled-checkers):

A list of Flycheck syntax checkers to exclude from automatic selection. Flycheck will never automatically select a syntax checker in this list, regardless of the value of `flycheck-checkers'.

只需将 (add-to-list 'flycheck-disabled-checkers 'c/c++-clang) 添加到您的初始化文件。