Hello, I’m Liang Xu.

Vim is a text editor that we use a lot in Linux. Vim is a free, open source text editor that does much the same as many other text editors, such as Sublime and Notepad++. Vim can be executed from the command line or operated from a graphical interface.

There are many tutorials for Vim, but in this article we will focus on changing Vim’s colors and themes.

Vim is not very friendly for beginners. But if you get used to Vim, you’ll find that you can’t live without it.

What is Vim’s theme?

The so-called theme, in fact, is essentially a color scheme, that is, a group of aesthetic, visually enhance the user’s use of the experience of the color combination. The Vim editor itself comes with some ready-made color schemes.

However, it is important to note that the Vim color scheme described here applies to the code, specifically to some keywords of the code with specific colors, not to the background color of the terminal.

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

:colorschemeCopy the code

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

: colorscheme + space + TabCopy the code

You just hit TAB multiple times after the space, switch to the color you want to set and press Enter. There are many default color schemes, such as the basic red, blue, black and gray, and the special desert and so on.

Download your favorite color scheme

What if you don’t like the default theme? There are plenty of great themes to be found on Github, and many of them are also available via Vimcolors.com. Some of these themes not only change the color of the code and syntax, but also the background color.

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

  1. First create a.vim directory:
$ mkdir ~/.vimCopy the code
  1. Then use the following command to clone the theme repository into your.vim folder:
    $ git clone <https://github.com/flazz/vim-colorschemes.git> ~/.vimCopy the code

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

  1. Enter Vim mode and select a theme using the previous command:
: colorscheme + space + TabCopy the code

Or, you can just specify the theme instead of hitting Tab all the time.

:colorscheme yourThemeCopy the code

However, neither operation is permanent, and once you close Vim, the theme will automatically reset again. If you want to default the Vim theme to your favorite theme, you can run this command:

$ echo 'colorscheme <desert>' >> ~/.vimrcCopy the code

Pick a favorite subject

Which theme to use is entirely up to personal preference, I personally prefer to use a theme with bright colors. Some people like dark themes, which are often used by hackers in movies. Others prefer colorful themes.

If you are not sure which topic to choose, here are some recommended options to look at.

Fairy-Garden

The Ice Age

Melancholy bluewery

synthwave84

anderson

Which subject do you like best? Let me know in the comments


Finally, recently, many friends asked me for Linux learning roadmap, so I stayed up for a month in my spare time according to my own experience, and sorted out an e-book. Whether you are interviewing or self-improvement, I believe will help you! The directory is as follows:

Free to everyone, just ask everyone to point to me!

Ebook | Linux development learning roadmap

Also hope to have a small partner can join me, do this e-book more perfect!

Have a harvest? Hope the old iron people come to a triple whammy, give more people to see this article

Recommended reading:

  • Dry goods | programmers advanced architect necessary resources free of charge
  • Artifact | support resource site search