Syntax coloring does not work as expected in VIM 6.3 on AIX 5.3

I turned on syntax highlighting for my C files by running the command :syntax on . I expected it to change the colors of keywords, etc. But, to my surprise, syntax highlighting happens, but all keywords are underlined instead of being colored!

Am I missing something?

+4
source share
3 answers

It seems that the problem is not in vim as such. The problem is with the terminals I use. According to the VIM documentation , the terminals I used, vt100 and xterm do not support colors! And therefore there are no colors in vim either!

But, to my surprise, on another server, xterm seemed to support 8 colors. I found this by running /usr/bin/tput colors , which printed -1 on a server where there were no colors and 8 on a server that supported colors.

Thanks to @Idigas for related pointers!

+4
source

Probably not. If syntax on changes the look of your buffer to something other than what you expect, you can check the contents of your collortem.

Try :echo g:colors_name to find out what it is, and then edit the above file.

Also :hi Normal and say :hi Comment and see how it looks there.

+1
source

Try to add

 set term=ansi 

to your ~/.vimrc file to override the term parameter for the duration of the vim session.

+1
source

Source: https://habr.com/ru/post/1395220/


All Articles