views:

197

answers:

3

How do I change the vimrc to have the comments in my code italicized?

in my vimrc file i have:

highlight Comment ctermfg=blue

that makes the comment blue.

A: 

How do you edit .vimrc?

vi ~/.vimrc

Does that not work? By default, it's looked for in your home directory.

Shawn D.
sorry question wrongly phrased, have fixed.
Hermann Ingjaldsson
+4  A: 
highlight Comment cterm=italic

You'll need a font with an italic set and a terminal capable of displaying italics. Also, if you're using a color scheme other than the default, the above line should come after the color scheme is loaded in your ~/.vimrc

michaelmichael
why should it be in a special color scheme file?i find it more convenient to have all the customization in one.is there any website where they show how to get this done?
Hermann Ingjaldsson
See my edit. It can be in your `~/.vimrc`, but it should come after the color scheme file is loaded, so that the color scheme file doesn't override your customizations. If you're not using a color scheme file (and it sounds like you aren't), don't worry about it.
michaelmichael
seems italicizing is more trouble than its worth.
Hermann Ingjaldsson
@Hermann that's not a trouble at all. It feels quite natural once You get used to it. Many programs are configured with these .*rc files on unix based systems.
Arnis L.
so where can i find the fonts with an italic set and is my terminal on kubuntu able to display italics?
Hermann Ingjaldsson
A: 

michaelmichael's answer should solve it for most cases. But, just in case you need this for a font in gvim that doesn't have italics (but oblique or something instead), you can try something like this in ~/.gvimrc

highlight Comment font=Bitstream_Vera_Sans_Mono_Oblique:h14

where h14 is the font size. This font should have the same cell size as your normal font though, so don't use an altogether different font.

Zubin