You are not logged in.
I tried to change the colorscheme in Vim to have comments in italic like this :
hi Comment guifg=#7C7C7C guibg=NONE gui=NONE ctermfg=gray ctermbg=NONE cterm=ITALIC
But this make the comments' color inverted, which is very ugly, and they are not in italic.
I'm using urxvt with the font DejaVu Sans Mono, but I think the problem comes from Vim because I can print italic text in the terminal.
Does someone know if it is possible to fix it ? Thank you !
Last edited by Pascal C.Plusplus (2012-10-30 18:59:45)
Offline
EDIT: Nevermind the following, I get the same problem you do with that highlight command. I do have italics in vim though, so I suspect something may be wrong with that highlight command. EDIT2: perhaps I only have italics on my other computer - sorry for potential misinformation - I'll check my other computer in a bit and hopefully I'll have more useful input.
Do you set the TERM environment variable outside of vim (eg in ~/.bashrc)? If so, remove it.
Do you set the "term" variable in ~/.vimrc? If not, add it as follows:
set term=screen-256color
Last edited by Trilby (2012-10-30 12:11:51)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Are you using a terminal multiplexer, e.g. tmux?
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
I use tmux, but the problem appears both in and out of tmux.
Offline
If the problem is present outside tmux, then you haven't defined font variants your terminal is supposed to use, e.g.
URxvt.font:xft:DejaVu Sans Mono:style=Book:pixelsize=13
URxvt.boldFont:xft:DejaVu Sans Mono:style=Bold:pixelsize=13
URxvt.italicFont:xft:DejaVu Sans Mono:style=Oblique:pixelsize=13
URxvt.boldItalicFont:xft:DejaVu Sans Mono:style=Bold Oblique:pixelsize=13
With the above, things should work as you wish in a bare urxvt session.
With tmux, however, the case looks differently and depends on the screen-256color terminal definition. There appear to be ways to work around the issue, though personally I'm happy with a regular font and slightly darker fg color for all the comments.
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
I have already defined font variants, and it didn't work. I dont think that the font is the problem, because I am able to print italic text with
echo -e "\e[3mitalic\e[m"
Offline
Did you run
xrdb -load ~/.Xresources
afterwards? Maybe your config file isn't sourced properly?
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
I just got to my other computer and italics work properly on this one. The only difference I could find between this (work) computer and my home computer is in the vimrc I do not set a term variable.
I tried setting the term variable in my vimrc and it replicated the problem, removing this fixed it again. So in contrast to my earlier incorrect suggestion, have you tried removing and "set term=..." commands from your vimrc?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Trilby : Thank you, now it works ! I just had to remove the "set term=..." line in my .vimrc and to set the TERM variable to rxvt-unicode-256color.
Offline