From the output, you can see the comments are very clear to read.
To make this change permanent create a hidden file named .vimrc in your home folder and add the below line:
Different color schemes are available under the directory /usr/share/vim/vim<version>/colors/.
Alternatively, you can see the available color schemes by opening vim and type :color <space> <press tab key> .
Method 2: Change terminal Background
You can change the default light background to dark. Open vim and add below line
Method 3: Using highlight comment command
You can use the highlight comment command to change the vim comment color. For example to change to vim comment to green, type:
:highlight Comment ctermfg=green
If using GUI vim, you can use hex color codes:
:highlight Comment guifg=#a26a4d
In this tutorial, we learned how to change comment color in vim. Thanks for reading, please leave your feedback and suggestions in the comment section.
If this resource helped you, let us know your care by a Thanks Tweet.
Did you find this article helpful?
We are glad you liked the article. Share with your friends.
About The Author
Bobbin is a seasoned IT professional with over two decades of experience. He has excelled in roles such as a computer science instructor, Linux system engineer, and senior analyst. Currently, he thrives in DevOps environments, focusing on optimizing efficiency and delivery in AWS Cloud infrastructure. Bobbin holds certifications in RHEL, CCNA, and MCP, along with a Master's degree in computer science. In his free time, he enjoys playing cricket, blogging, and immersing himself in the world of music.