How to Customize Vim Colors and Themes: A Step‑by‑Step Guide
This guide explains what Vim color schemes are, shows how to view and switch built‑in schemes, demonstrates installing external themes from GitHub, and details how to make a chosen theme permanent, complete with example commands and recommended theme previews.
Vim is a free, open‑source text editor widely used on Linux, available both in command‑line and graphical modes. This article focuses on changing Vim's colors and themes to improve visual comfort while coding.
A Vim theme (or color scheme ) is essentially a set of aesthetically chosen colors applied to syntax elements in the editor, not the terminal background. Vim ships with several built‑in schemes.
To see the current color scheme, open Vim and run: :colorscheme To list all available built‑in schemes, type a space after :colorscheme and press Tab repeatedly to cycle through them, then press Enter to select one. Common defaults include red, blue, black‑gray, and special ones like desert .
If you prefer a theme not included by default, you can download external schemes from GitHub (many are also listed on Vimcolors.com). Install them as follows:
Create a .vim directory in your home folder: $ mkdir ~/.vim Clone the theme repository into that directory, for example:
$ git clone https://github.com/flazz/vim-colorschemes.git ~/.vim(Replace the URL with the repository of the desired theme.)
Reopen Vim and select the new theme using the same :colorscheme + Tab method, or directly specify it: :colorscheme yourTheme These selections are temporary; Vim will revert to the default when closed. To make a theme permanent, append the following line to your ~/.vimrc file: $ echo 'colorscheme desert' >> ~/.vimrc Below are some popular community‑recommended themes (shown with preview images):
童话花园 (fairy‑garden)
冰河世纪 (ice‑age)
忧郁 (bluewery)
synthwave84
anderson
Choose the theme that best fits your visual preference; brighter schemes are popular, while darker ones suit a “hacker” aesthetic.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
