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 change the theme of Vim in Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Vim is a very common text editor we use in Linux. Vim is a free, open source text editor with roughly the same functionality as many other text editors, such as Sublime and Notepad++. Vim can be executed either on the command line or in a graphical interface.

There are many tutorials for Vim, and this article focuses on how to change the color and theme of Vim.

Vim is not very friendly for beginners. But if you are proficient in using Vim, you will find that you can no longer live without Vim.

What is the theme of Vim?

The so-called theme, in fact, is essentially a color scheme, that is, a group of aesthetic color combinations that visually enhance the user's experience. The Vim editor itself comes with some off-the-shelf color schemes.

However, it should be noted that the Vim color scheme described here is applied to the code, specifically adding specific colors to some keywords of the code, not to the background color of the terminal.

To view the current Vim color scheme, enter the following command after entering the Vim interface:

: colorscheme

To see what default configuration schemes are available, you can use the following command:

: colorscheme+ space + Tab

In fact, it is to click the tab key many times after the space, switch to the color you want to set, and then enter to set it. There are many default color schemes, such as basic red, blue, black and gray, special desert and so on.

Download your favorite color copy

What if you don't like the default theme? We can find a lot of good topics on Github, and many of them can also be found through Vimcolors.com. Some of these themes change not only the color of the code and syntax, but also the background color.

Once you have found your favorite themes, you can apply them to your Vim in the following ways.

First create a .vim directory:

$mkdir ~ / .vim

Then clone the theme repository to your .vim folder using the following command:

$git clone ~ / .vim

The address in the above angle brackets may change depending on the subject item.

Enter Vim operation mode and use the previous command to select the theme:

: colorscheme+ space + Tab

Alternatively, you can specify the theme directly, instead of hitting the Tab key all the time.

: colorscheme yourTheme:colorscheme yourTheme

However, neither of these operations is permanent, and once you close Vim, the theme will automatically reset. If you need to default the theme of Vim to your favorite theme, run the following command:

$echo 'colorscheme' > > ~ / .vimrc choose a favorite theme

Which theme to use depends entirely on your personal preference. I personally like to use themes with brighter colors. Some people like black themes, which are often used by hackers in movies. There are also people who like color themes.

If you are not sure which topic to choose, here are some recommended solutions to refer to.

The original text is from: https://www.linuxprobe.com/linux-vim.html

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