We can change the background and foreground colors in Vim editor using the colorscheme.
Let's say you have opened a file using Vim and now you want to change the color scheme, you can simply type :colorscheme followed by the name of the color scheme.
Example:
:colorscheme desert

List of Color Schemes: Vim
| Colorscheme Name | Background Color | Foreground Color |
|---|---|---|
| desert | Dark Gray | Light Orange |
| gruvbox | Dark Brown | Light Beige |
| solarized | Dark Blue-Green | Light Blue-Gray |
| molokai | Dark Charcoal | Light Gray |
| nord | Dark Blue-Gray | Light Gray-Blue |
| dracula | Dark Purple-Blue | Light Gray |
| onedark | Dark Blue-Gray | Light Gray |
| monokai | Dark Green-Gray | Light Gray |
| jellybeans | Dark Purple | Light Beige |
| iceberg | Dark Blue-Gray | Light Blue |
Adding the colorscheme in .vimrc:
Open the .vimrc file using the vim editor and add the following line.
vim ~/.vimrc
colorscheme desert
Save and Quit.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!