在 gnome 终端、tmux 和 vim 中配置曝光颜色方案 [英] Configuring solarized colorscheme in gnome terminal, tmux and vim

查看:28
本文介绍了在 gnome 终端、tmux 和 vim 中配置曝光颜色方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力使 Solarized 颜色方案在 gnome 终端内的 tmux 内的 Vim 内的 Ubuntu 13.10 机器上正确工作.

I'm struggling to make the Solarized colorscheme correctly working on an Ubuntu 13.10 machine inside Vim inside tmux inside the gnome-terminal.

我已经开始使用 此存储库 上的脚本配置 gnome-terminal 并显示颜色正确.如果我在没有 tmux 的情况下在终端内运行 Vim(使用官方 Solarized 配色方案),情况也是如此.

I've started configuring gnome-terminal using the script on this repository and it displays the colors correctly. The same goes if I run Vim (with the official Solarized colorscheme) inside the terminal, without tmux.

然后我尝试使用 this 配置 tmux.碰巧当我运行 Vim 时,php 或 javascript 代码的语法高亮是错误的,或者至少与我看到的在没有 tmux 的情况下运行 Vim 不同.我也试过将 tmux 作为 tmux -2 运行.颜色不同,但语法高亮仍然不正确.

Then I tried to configure tmux using this. It happens that when I run Vim the syntax highlight for php or javascript code is wrong or, at least, different from the one I see running Vim without tmux. I've tried also running tmux as tmux -2. The colors are different, but still the syntax highlight is not correct.

推荐答案

我对其进行了测试,并通过以下方式使其工作:

I tested it out and got it working in the following way:

  1. 安装 gnome 曝光颜色方案.您可以从 https://github.com/sigurdga/gnome-terminal-colors-solarized 获取它.

为vim安装solarized colorscheme.您可以从 https://github.com/altercation/vim-colors-solarized 获取它.在 .vimrc 中,您应该添加以下设置:

Install solarized colorscheme for vim. You can get it from https://github.com/altercation/vim-colors-solarized. In .vimrc you should add following settings:

set t_Co=256
set background=dark
colorscheme solarized

  • 通过在 .bashrc/.zshrc 中添加以下行来设置正确的 TERM 变量

  • Set correct TERM variable by adding following line to your .bashrc/.zshrc

    export TERM=screen-256color-bce
    

  • 运行 gnome-terminal、tmux、vim 和利润.

  • Run gnome-terminal, tmux, vim and profit.

    这篇关于在 gnome 终端、tmux 和 vim 中配置曝光颜色方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆