By default, if you open the vi application on Linux (especially using PuTTY), the color for comments is blue. However, sometimes this makes it very difficult for me to read the comments, especially if the background color of the terminal is black.
Problem
How to change the color of comments in the vi application?
Solution
Below is an image of a /etc/crontab file opened using Putty:

For me, it’s very difficult to read the comments in the Linux file if they’re blue like in the image above. So, if you want to change the color of comments in the vi application, for example, if you want to change the color of comments to yellow, then open the .vimrc file by:
vi ~/.vimrc
Type the script below into the file:
highlight Comment ctermfg=yellow
After that, open the file using the vi application, and the comments on the file should change to yellow as in the image below:

You can see that the comment color is changed to yellow after you configure the .vimrc file.
Note
Currently, the vi application can support up to 256 colors that can be used in the vi application. So if you want to use more colors supported by the vi application, in the .vimrc file type the script below:
set t_Co=256
Then you can choose the colors on this page, for example, you want to use purple for comments, then enter the script below in the .vimrc file:
set t_Co=256
highlight Comment ctermfg=93
Then the comments in the vi/vim application should be purple as in the image below:


