Today, I am satisfied with my work environment configuration. at the same time, I have made a step towards understanding the color configuration. So record the memo. First, we found a problem. The Color Display result of the font may be related to the terminal. For example, in the same configuration file, putty is used to link the display effect of the host and terminal is used on the desktop.
Today, I am satisfied with my work environment configuration. at the same time, I have made a step towards understanding the color configuration. So record the memo.
First, we found a problem. The Color Display result of the font may be related to the terminal. For example, in the same configuration file, the display effect of using putty to link the host is completely different from that of using terminal on the desktop.
The problem of putty is not discussed here. due to the poor color effect, if you need remote login, you will use VNC to solve the problem. putty makes a simple configuration connection, it is not used as the main editing method.
The cterm solution on the desktop is mentioned below, and it is satisfactory to use it on debian.
First, the color of the terminal. by default, the system color is white and black. it looks a little too bright. I like dim colors. In fact, bg = black, and the foreground color is dark green. But there is a problem: generally, different files are displayed in different colors, while normal files are generally displayed in white. In my system, the default executable file color is green, so if the common file is green, it will not be clear. Therefore, the color scheme I used finally asked: The background color is # 2D2D2D, and the foreground color is # BBBBBB. Is the dark gray background, light gray prospects. The results are good.
Followed by the vim configuration. I used to figure out how to change the color of vim to meet my own needs. this time I finally achieved a slight reduction.
First, create a local folder. The vim system file is called $ VIMRUNTIME in vim. in Linux, it is usually/usr/share/vim/vim72. If local is used, create a. vim/hidden folder under $ HOME, and create various configuration folders like $ VIMRUNTIME. For example, place your own color scheme in ~ /. Vim/colors. The preparation is complete.
Then, of course, the syntax highlighting: set syntax on should be enabled in vimrc. There is a concept here. I have never understood how syntax files and color files perform their respective duties. The current feeling should be like this: the syntax file only defines some pattern matching methods. For example, in Vim, some modes are called comment comments, some modes are called type, and some modes are called statements ). Vim searches for the corresponding syntax file based on the extension, and then matches the text in the pattern. If C ++ is used as an example, it may encounter something starting with #. it knows that it is a processor command and classifies these things into the PreProc mode. If you encounter int, char, or double, you will know that it is a type. Therefore, it will be classified as the type mode. If, while, and so on are met, they are classified as statement. Which modes are defined by Vim. How to trigger the matching of these modes, such as using // to indicate the annotation or # to indicate the annotation, which is defined by the syntax file.
Therefore, with these foundations, Vim's color scheme is actually very simple. Let me define different syntax items (the color used in the pattern mentioned above. For example, the darkblue color scheme stipulates that in cterm, the comment is displayed with darkred, the Constant is displayed with magenta, and the Statement is displayed with yellow. For example:
In other words, the darkblue color scheme is actually for the gui. The cterm is not actually blue, but I like it very much.
So, if you want to change the color type, just change the color in the color scheme. What colors are supported? This can be found in help. In vim, use: help cterm-colors to find the following description:
In this way, you can change the color you want. If you want to find the color under the gui, you can use the following methods: help gui-colors.
In addition, if you want to change the font of a specific item, you can use cterm = bold or gui = bold.
Note that fonts of different colors do not look the same in width. Even if the font is normal.