Make text bold in vim
I am working on Ubuntu and using vim to make C files. I want to make the entire text in the editor bold. How can I do that without installing any plugin? I am not looking to make specific words bold. I am using a black background. Colors in bold would make the editor look really good.
You can use the :match
command to apply a highlight to a given regular expression.
For gVim:
:highlight MyGroup gui=bold
:match MyGroup /./
For terminal:
:highlight MyGroup cterm=bold
:match MyGroup /./
The correct answer was given to me by one of the users @akira in one of the comments. I am just sharing it.. You can change the font only in GVim. Vim uses the fonts that you are using in the shell. So if you happen to be reading this and have the same requirement the best thing would be to change the settings of your shell such that it displays fonts in bold. I believe this is the best method.
You can make bold some elements of C file. For example
:highlight Comment gui=bold
will make comments in C files bold for GVim. For console Vim it will be
:highlight Comment cterm=bold
Unfortunately, I do not know other way to make all text bold except for making it bold for each highlight group (cComment
, cNumber
, etc.).