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.

  • are you running vim in a terminal or a gui version? – pb2q Oct 17 '12 at 16:31
  • I believe you should configure the terminal, not vim. Hence 1) asking what terminal do you use? 2) seconding the request to move the question to superuser. – ZyX Oct 17 '12 at 20:05
  • @Zyx: I use the bash terminal – Parth Shah Oct 18 '12 at 2:25
  • @ParthShah No, bash is the shell and not a terminal. “Terminal” here is a short of “terminal emulator”: GUI application you use. – ZyX Oct 18 '12 at 3:06

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.

  • Also, note that a font has different files for its styles, so just downloading "SomeFont.ttf" does not mean you download all styles, but most likely only "Regular". All desired font styles need to be installed separately. – SidOfc Mar 25 '20 at 12:28

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 /./

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.).


Adjust your terminal emulator's settings to make your fonts bold.

On a tty console, run:

$ sudo dpkg-reconfigure console-setup

and then adjust settings from there.

Note: You cannot do this in xterm.


For Gvim only: Change the font to bold using(Monospace in this example)

:set guifont=Monospace\ Bold\ 11 

Put it in your .gvimrc if you want to do it every time.

  • Nothing changes. Can you plz tell me what can be the reason? – Parth Shah Oct 18 '12 at 2:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.