Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make comments Italic in gVim?

I am fairly new to Vim and mainly use gVim for most of my coding purposes. I am trying to figure out what to add in my _vimrc (in windows) to make my comments italic.

I tried adding

highlight Comment cterm=italic

but that didn't work. My modifications so far in my vimrc (if it matters) is:

color slate
set number
set nowrap
set guioptions+=b
if has('gui_running')
  set guifont=Consolas:h10
endif

So what can I do so that my comments appear in italics (consolas, italic, size 10)?

like image 387
wrahim Avatar asked Dec 04 '25 14:12

wrahim


1 Answers

The cterm definition is only for high color terminals; for the GUI, you need to use the gui= argument:

highlight Comment cterm=italic gui=italic

Also, put this after the :colorscheme command in your ~/.vimrc, or else it might get overridden.

like image 198
Ingo Karkat Avatar answered Dec 07 '25 03:12

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!