如何关闭所有针对Golang的Vim设置?

huangapple go评论85阅读模式
英文:

how to turn off all vim settings for golang?

问题

你可以通过在vim中使用以下命令来关闭Go语言的语法高亮:

:autocmd FileType go syntax off

这将禁用Go文件的语法高亮。如果你只想禁用空格的红色高亮,可以尝试其他方法。

英文:

How could I turn off syntax highlighting in vim, but only for Go?

I've seen a few posts about just turning off the red-highlighting for white space but that's not quite what I'm looking for.

答案1

得分: 3

将以下行添加到你的 vimrc 文件中:

autocmd FileType go setlocal syntax=OFF
英文:

Add the following line to your vimrc file:

autocmd FileType go setlocal syntax=OFF

答案2

得分: 1

考虑到vim文档中的说明:

> 一个语言的语法和高亮命令通常存储在一个语法文件中。
命名约定为:“{name}.vim”。其中{name}是语言的名称或缩写。

如果你能找到一个go.vim文件(类似于这个),并将其删除(或移动),那么就可以禁用Go语言的语法高亮。

英文:

Considering that the vim documentation states

> The syntax and highlighting commands for one language are normally stored in
a syntax file.
The name convention is: "{name}.vim". Where {name} is the
name of the language, or an abbreviation

If you can find a go.vim file (similar to this one) and delete it (or move it), that should disable the syntax highlighting just for Go.

huangapple
  • 本文由 发表于 2017年6月7日 13:16:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/44404052.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定