英文:
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
答案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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论