vimrc make comments italic

前端 未结 5 1500
说谎
说谎 2021-02-01 14:08

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

In my ~/.vimrc file I have:

highlight Comment ctermfg=         


        
5条回答
  •  -上瘾入骨i
    2021-02-01 14:28

    In my case I had to put this in my vimrc file:

    let &t_ZH="\e[3m"
    let &t_ZR="\e[23m"
    highlight Comment cterm=italic
    

    Notice it is not the same as:

    set t_ZH=^[[3m
    set t_ZR=^[[23m
    highlight Comment cterm=italic
    

    The former worked for me, while the latter didn't.

提交回复
热议问题