在搜索如何在 vim 中设置语法高亮时,我发现这个页面说 vimrc 应该有以下行
syntax on
Run Code Online (Sandbox Code Playgroud)
为什么不是这样的set syntax on?就像我们有set nu,set ai等等。
有了set syntax on,我得到这个错误
$ vi
syntax=
Error detected while processing /home/lazer/.vimrc:
line 30:
E518: Unknown option: on
Hit ENTER or type command to continue
Run Code Online (Sandbox Code Playgroud)
和set syntax,我明白了
$ vi
syntax=
Hit ENTER or type command to continue
Run Code Online (Sandbox Code Playgroud)
它应该是syntax on或syntax off。
set syntax=something 用于更改当前语法(c、perl、nasm 等)。
更新:正如@garyjohn 在评论中指出的那样,可以使用set syntax=ONand为当前缓冲区及其相应的文件类型打开/关闭它set syntax=OFF。
| 归档时间: |
|
| 查看次数: |
5704 次 |
| 最近记录: |