The beloved Solarized colour scheme seems to apply an italic face for comments, but when I am using it in vim
in iTerm2, it does not.
So, everything including comments are displayed in Roman (normal) face.
Even if I select the Menlo font, which has an italic face I can see in iTerm2's preferences window, the comments are rendered as Roman.
Together with the fact that comments are in light gray, and normal text in (not very bright) white, comments become rather difficult to distinguish from normal text.
To me this is a flaw in the otherwise great color scheme. I did some searching but the advice is old and do not solve the problem. I'm using OS X 10.6 Sierra on a MacBook Air.
Best Answer
You have to update your
TERMINFO
file.Thanks to wincent's video and his github pages
Watch the video and look at his github pages, they're excellent.
I have the following note stored on my HD:
We can have italics in the terminal.
This works in iTerm as well as Terminal.
We have to adapt the terminfo database to tell it to display italics.
Create a plain text file which contains the following:
Save it as
xterm-256color.terminfo.txt
Then execute the following command:
This will create a
~/.terminfo/some_arbitrary_number/
directory, and inside that directory is axterm-256color
file.What it does according to the manpage:
So with the given command we are writing a new terminfo entry in the hidden
~/.terminfo
directory. It takes the capabilities of the existing xterm-256color entry (from/usr/share/terminfo/
) and adds italics mode to it.To check that the terminal does the right thing:
with fish:
with bash or zsh:
I guess at the moment most vim terminal colorschemes don't set italic as a style. To check this do:
:hi Comment
if the reply containscterm=italic
you're done. If not addhighlight Comment cterm=italic
to your vimrc (below setting your colorscheme).Addendum for tmux
tmux uses its own terminfo files, they also need to be updated to use italics.
tmux.terminfo.txt
file which containstmux|tmux terminal multiplexer, sitm=\E[3m, ritm=\E[23m, smso=\E[7m, rmso=\E[27m, use=screen,
tmux-256color.terminfo.txt
file which containstmux-256color|tmux with 256 colors, sitm=\E[3m, ritm=\E[23m, smso=\E[7m, rmso=\E[27m, use=screen-256color,
and run the tic command.
tic -o ~/.terminfo tmux-256color.terminfo.txt
and
tic -o ~/.terminfo tmux.terminfo.txt