在 gnome 终端、tmux 和 vim 中配置曝光颜色方案

编程入门 行业动态 更新时间:2024-10-26 04:22:49
本文介绍了在 gnome 终端、tmux 和 vim 中配置曝光颜色方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在努力使 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:

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

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

Install solarized colorscheme for vim. You can get it from https://github/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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 05:13:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390105.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:终端   颜色   方案   gnome   vim

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!