Vim custom color scheme, illustrated by text, vim Color Scheme

Source: Internet
Author: User

Vim custom color scheme, illustrated by text, vim Color Scheme

1. First 

The following is the source code of tcpdump. The color is configured according to your preferences. I prefer bright colors and can see them clearly!

 

2. Download the auxiliary configuration file

First, we download a vim plug-in xterm-color-table.vim,: http://www.vim.org/scripts/script.php? Script_id = 1, 3412

This plug-in can display the numbers corresponding to various colors of the terminal, so that you can refer to the color.

Download and put the xterm-color-table.vim in your home directory ~ /. Vim/plugin. Or put it in your global vim configuration folder.

Next, open vim and enter: Xt in command mode. The options are uppercase x and lowercase t. Then press <tab> complete to set the value to XtermColorTable. After you press enter, the following interface is displayed:

 

Tip: If no color is displayed after it is turned on, the display is all numbers and you need to add export TERM = xterm-256color to your. bashrc bash environment file to enable the 256 color for the term

 

3. Color 

By default, the color scheme of vim is desert. vim, which is my first color scheme. Let's modify it. The path of my machine is in/usr/share/vim/vim74/colors/desert. vim.

Cp one copy to your home directory ~ Under/. vim/colors/, or you go to the global configuration folder and copy cp to change the name.

Open this file and follow the following changes to the color. During modification, we recommend that you comment out the original line. A new line of cp will be added to prevent errors if there is no reference!

1 "Comment 2 hi Comment ctermfg = 14 3" Constant 4 hi Constant ctermfg = 202 5 "Special in C language is % add type placeholder, escape characters, etc. 6 hi Special ctermfg = 200 7 "for if where, etc. 8 hi Statement ctermfg = Yellow 9" preprocessing 10 hi PreProc ctermfg = 19711 "Type 12 hi Type ctermfg = Green13" Search color 14 hi Search term = bold ctermbg = 4 guibg = DarkBlue

The above ctermfg is the color to be modified, and "Yellow" "Green" are the most basic colors of the term. In fact, you can also directly replace the XtermColorTable with a number.

After modification, remember to modify the color file name corresponding to colorscheme in your. vimrc file!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.