Vim 语法高亮不起作用 [英] Vim Syntax Highlighting does not work
问题描述
我在笔记本电脑上安装了全新的 Arch Linux 系统并下载了 vim 包.
I've installed a fresh Arch Linux system on my laptop and downloaded the vim package.
我没有更改 .vimrc 文件,但语法高亮似乎不适用于我尝试过的任何语言(Python、Ruby、CSharp、C...).
I haven't altered the .vimrc file, but the syntax highlighting doesn't seem to work with any of the languages I tried (Python, Ruby, CSharp, C...).
自动格式化(gg、=、G)也失败.
Auto formatting (gg, =, G) also fails.
直到现在在其他操作系统(Ubuntu、Fedora)中使用 vim(因为我不能说我已经广泛使用它)时,语法突出显示会自动出现.有什么我在这里遗漏的吗?
Until now when playing with vim (because I can't really say I've extensively used it) in other OSs (Ubuntu, Fedora), the syntax highlighting came on automatically. Is there something I am missing here?
推荐答案
您需要在 .vimrc 文件中进行以下设置 根据 arch linux 文档
You need to have following settings in .vimrc file as per arch linux documentation
filetype plugin on
syntax on
这篇关于Vim 语法高亮不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!