【问题标题】:How do you get color to show in iTerm2?如何在 iTerm2 中显示颜色?
【发布时间】:2014-01-05 14:49:58
【问题描述】:

如何在 iTerm2 或终端中显示颜色?

我设法让我的 Vim 编辑器显示颜色。这是我的 .vimrc 文件中的内容。

设置 term=xterm-256color

配色方案之夜

语法启用

根据我的研究,我认为 terminfo 文件中可能缺少某些内容,但我不知道该怎么处理。我正在使用 Mac OS X 10.9.1

【问题讨论】:

    标签: terminal color-scheme iterm2


    【解决方案1】:

    我在 OS X 10.9.1 上使用 VIM 和 iTerm 2。在我的 .vimrc 中,我有以下内容(请注意,我使用的是 molokai 配色方案,您可以使用 'evening' 进行切换):

    let &t_Co=256
    colorscheme molokai
    syntax on
    

    这些设置最适合我。这些设置还解决了我在 tmux 会话中使用 VIM 时遇到的一些颜色问题。

    另外,在 iTerm 的首选项中,在 Profile > Whatever Profile You're Using > Terminal 下,确保“Report Terminal Type”设置为:

    screen-256color
    

    希望对您有所帮助。

    【讨论】:

      【解决方案2】:

      colorscheme 应该写成一个单词。我认为在.vimrc 中设置term 是不必要的。

      【讨论】:

        猜你喜欢
        • 2011-11-17
        • 2013-01-15
        • 1970-01-01
        • 1970-01-01
        • 2017-05-20
        • 1970-01-01
        • 2013-03-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多