3

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

wrahim
  • 1,158
  • 4
  • 16
  • 33

1 Answers1

4

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.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • Glad I could help. Please don't forget to accept the answer by clicking on the outlined checkmark next to it! – Ingo Karkat May 29 '14 at 17:38
  • thanks @IngoKarkat, the `gui=italic` part also fixed it in neovim run by kitty. Even though it's still "terminal" – Trey Stout Nov 13 '18 at 03:28