如何在vim中显示实际的语法高亮?
How display actual syntax highlight in vim?
最近我使用 vim 文本编辑器编写了一个没有文件扩展名的文本文件,并为单引号之间的所有单词(如 'word'
和所有以冒号结尾的单词(如 [=)突出显示文本12=]
我喜欢这种突出显示的方式。
但是因为我没有输入任何通常以 ESC
:command
开头的命令,所以我很惊讶怎么会这样。
是否有显示正在使用的实际语法高亮的命令?
我已经尝试过命令 :set syntax=php
,它看起来很相似,只是颜色不同,比如 word:
有人有什么建议吗?
尝试输入命令
:echo &syntax
这将显示 syntax
变量设置的值。
set option=value "set the option with value
set option? "read/print the current value of the option
set option! "set the option with opposite value, like set nu and set nu!
选项值也保存在变量&option
中,因此您可以通过脚本方式读取。
最近我使用 vim 文本编辑器编写了一个没有文件扩展名的文本文件,并为单引号之间的所有单词(如 'word'
和所有以冒号结尾的单词(如 [=)突出显示文本12=]
我喜欢这种突出显示的方式。
但是因为我没有输入任何通常以 ESC
:command
开头的命令,所以我很惊讶怎么会这样。
是否有显示正在使用的实际语法高亮的命令?
我已经尝试过命令 :set syntax=php
,它看起来很相似,只是颜色不同,比如 word:
有人有什么建议吗?
尝试输入命令
:echo &syntax
这将显示 syntax
变量设置的值。
set option=value "set the option with value
set option? "read/print the current value of the option
set option! "set the option with opposite value, like set nu and set nu!
选项值也保存在变量&option
中,因此您可以通过脚本方式读取。