为什么不突出显示成员类中的关键字?

时间:2015-11-12 09:22:29

标签: c++ vim vim-syntax-highlighting

enter image description here

为什么private中的publicclass hold未突出显示?

1 个答案:

答案 0 :(得分:0)

First finish the programme, then save the file as a .cpp file with the following vim command :

w your_programme_name.cpp

Vim might be applying the current color settings. Try to override the current color settings with defaults using the below vim command :

syntax on

Occasionally though, I have seen vim getting confused on what to apply where. Below is the help text from Vim Documentation. This might be the last resort.

The colors are wrong when scrolling bottom to top. Vim doesn't read the whole file to parse the text. It starts parsing wherever you are viewing the file. That saves a lot of time, but sometimes the colors are wrong.

A simple fix is hitting CTRL-L.

Or scroll back a bit and then forward again.

For a real fix, see |:syn-sync|.

Some syntax files have a way to make it look further back, see the help for the specific syntax file. For example, |tex.vim| for the TeX syntax.