语法着色在 AIX 5.3 上的 VIM Editor 6.3 中未按预期工作
我通过发出命令 :syntax on
为我的 C 文件启用了语法突出显示。我预计它会改变关键字的颜色等。但令我惊讶的是,语法突出显示正在发生,但所有关键字都带有下划线而不是彩色!
我错过了什么吗?
I enabled syntax highlighting for my C files by issuing the command :syntax on
. I expected it to change the colors of keywords etc. But to my surprise, syntax highlighting is happening, but all keywords are being underlined instead of being colored!
Am I missing out something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看来问题不在于
vim
本身。问题出在我正在使用的终端上。根据 VIM 文档,终端我正在使用,vt100
和xterm
不支持颜色!因此vim
中也没有颜色!但令我惊讶的是,在另一台服务器上,
xterm
似乎支持 8 种颜色。我通过运行/usr/bin/tput color
发现了这一点,它在没有颜色的服务器上输出-1
,在服务器上输出8
支持颜色。感谢@Idigas 的适当指点!
It seems that the problem is not with
vim
as such. The problem is with the terminals I am using. According to VIM Documentation, the terminals I was using,vt100
andxterm
don't support colors! And hence no colors invim
too!But to my surprise, on another server,
xterm
seemed to support 8 colors. I found this by running/usr/bin/tput colors
which outputted-1
on the server where there were no colors and8
on the server which supported colors.Thanks to @Idigas for the appropriate pointers!
可能不会。如果
syntax on
将缓冲区的外观更改为与您期望的不同的内容,您可能需要检查颜色主题的内容。尝试
:echo g:colors_name
看看它是哪一个,然后编辑上述文件。另外,
:hi Normal
和:hi Comment
看看它在那里的样子。Probably not. If
syntax on
is changing the looks of your buffer to something different than what you expect, you might want to check out the contents of your colortheme.Try
:echo g:colors_name
to see which one it is, and then editing the aforementioned file.Also,
:hi Normal
and let's say,:hi Comment
and see how it looks in there.尝试添加
到您的
~/.vimrc
文件中,以覆盖vim
会话期间的term
设置。Try adding
to your
~/.vimrc
file to override yourterm
setting for the duration of yourvim
session.