Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the highlight color of linux Vim

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to set the highlight color of linux Vim". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to set the highlight color of linux Vim.

1. Use the highlight command

Colors (including fonts and other styles) are set in Vim using the hightlight command, which can be abbreviated to hi. For example, the setting of the function name:

Highlight Function cterm=bold,underline ctermbg=red ctermfg=green

This command changes the font of the function name to bold / underlined / green / red background. In addition to the Function keyword, there are String/Number/Float/Label, as well as keywords for a programming language such as phpFunctions/phpType/phpFloat, etc.

two。 View all existing settings

Just execute the highlight command without any parameters.

The effect is as follows:

The column on the left is the keyword that can be set for it, the middle is the effect of the style, and the right is the specific parameters of the setting. Among them, gui/guibg is the setting of gvim, which can be ignored if gvim is not used.

3. Example: my two settings

(1) setting the tab tag style

Every theme has its flaws, such as torte, which I have always liked to use. Its default style is that the tab tag is underlined in black and white, and the selected state is ununderlined, which looks very eye-consuming. I made the following settings:

Highlight TabLine term=underline cterm=bold ctermfg=9 ctermbg=4

Highlight TabLineSel term=bold cterm=bold ctermbg=Red ctermfg=yellow

Two tags are involved here: TabLine (normal label style) / TabLineSel (style of the selected status tag).

Effect:

(2) setting the prompt style of automatic completion.

The prompt plug-in I use is AutoComplPop.

Highlight Pmenu ctermbg=darkred

Highlight PmenuSel ctermbg=red ctermfg=yellow

Effect:

At this point, I believe you have a deeper understanding of "how to set the highlight color of linux Vim". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report