Vim 上的 Solarized 主题 +终结者+乌班图11.10

发布于 2025-01-01 06:07:33 字数 518 浏览 3 评论 0原文

我正在尝试为终结者上的 vim 设置 Solarized 主题,但它不起作用。 :-( 我成功地为终结者设置了 Solarized,但它似乎不适用于 vim。这是我的 .vimrc 的样子,

call pathogen#infect()
filetype plugin indent on
syntax enable
set background=dark
"set t_Co=16
"let g:solarized_termcolors=16
let g:solarized_visibility = "high"
let g:solarized_contrast = "high"
colorscheme solarized

$TERM is set to xterm

我也尝试过上面两行未注释的内容,但仍然无法正常工作。

有人可以告诉我我做错了什么吗?

谢谢!

编辑: solarized vim

I am trying to setup solarized theme for vim on Terminator but it is not working. :-(
I was successfully able to setup solarized for terminator but it just doesn't seem to work for vim. Here is what my .vimrc looks like

call pathogen#infect()
filetype plugin indent on
syntax enable
set background=dark
"set t_Co=16
"let g:solarized_termcolors=16
let g:solarized_visibility = "high"
let g:solarized_contrast = "high"
colorscheme solarized

$TERM is set to xterm

I have also tried it with the two lines above uncommented but still not working.

Could someone please tell me what I am doing wrong?

Thanks!

Edit: solarized vim

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柠檬色的秋千 2025-01-08 06:07:33

正如 Ethan Schoonover 在他的 vim colorcheme 自述文件中指出的那样,要使 colorcheme 首先工作,您必须配置终端颜色调色板。

在 terminator 中,有一个 github 存储库,其中保存了深色和浅色方案的颜色配置。

问题是那个调色板也不正确:P,正确的调色板是一个人在

正确的配置如下(至少对于深色方案):

[[solarized-dark]]
  palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
  cursor_color = "#eee8d5"
  foreground_color = "#eee8d5"
  background_color = "#002b36"

之后,您必须配置日光颜色方案:

syntax on
set t_Co=16
set background=dark
colorscheme solarized

需要记住的几件事:

  1. 通常,set t_Co=16 行不是必需的,因为大多数终端仿真器仅支持 16 种颜色(例如终止符)。但我宁愿明确而不是隐含(特别是如果您要在多台计算机之间同步文件)。

  2. set g:solarized_termcolors=16 行是默认设置,因此您可以放置​​或不放置:它不会有任何区别。

  3. 根据我的经验,256 色版本更好(我更喜欢灰色背景而不是蓝色背景;但那是个人品味:P)。与每个人的想法相反,256 配色方案实际上是“后备”配色方案,即默认的 16 配色方案。是的,很奇怪,大多数人会认为 256 > 16.无论如何,要使用“后备”,您必须将行更改为以下内容:

    <前><代码>设置 t_Co=256
    设置 g:solarized_termcolors=256

  4. 其他 CLI 应用程序中的颜色输出实际上存在一些问题,我建议您去阅读 Seebi 文章 关于 dircolorssolarized github 问题跟踪器上正在进行的(?)讨论

As Ethan Schoonover pointed out in his vim colorscheme readme, to make the colorscheme work first you have to configure your terminal colour palette.

In terminator there is a github repo that holds the colour configuration for the dark and light scheme.

The problem is that that palette isn't right either :P, the correct one is the one a guy posted in an issue on that same repo.

The correct configuration is the following (at least for the dark scheme):

[[solarized-dark]]
  palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
  cursor_color = "#eee8d5"
  foreground_color = "#eee8d5"
  background_color = "#002b36"

After that, you have to configure the solarized colorscheme:

syntax on
set t_Co=16
set background=dark
colorscheme solarized

A couple of things to have in mind:

  1. Normally, the set t_Co=16 line is not necessary because most terminal emulators only support 16 colours (terminator for example). But I rather be explicit than implicit (specially if you are going to sync your files between multiple computers).

  2. The line set g:solarized_termcolors=16 is the default, so you can put it or not: it won't make any difference.

  3. In my experience the 256 colour version is better (I like more grey background over a blue one; but that's personal taste :P). Contrary to what everyone could think, the 256 colour scheme is actually the 'fallback' being the 16 one the default. Yeah, weird, most people would think that 256 > 16. Anyway, to use the 'fallback' you have to change the lines to the following:

    set t_Co=256
    set g:solarized_termcolors=256
    
  4. There are actually some issues with colour output in other CLI applications, I suggest you to go and read Seebi article about dircolors and an ongoing(?) discussion on the solarized github issue tracker.

苏佲洛 2025-01-08 06:07:33

很确定你不需要 vim 颜色主题导入,因为你已经设置了终结者的配色方案。至少,这是我在大量试验和错误之后让它发挥良好作用的唯一方法。

这是我的 vimrc 的屏幕截图,来自 vim,在终止符内:

在此处输入图像描述

如您所见,我还没有接到电话了,

colorscheme solarized

所以你可以尝试把它去掉——它似乎终于对我有用了!

PS你的截图看起来不像是从《终结者》中截取的——当然,除非我们谈论的是不同的《终结者》。

Pretty sure you don't need the vim color theme import, since you already set up the color scheme for terminator. At least, that was the only way I could get it to play nice after lots of trial and error.

Here's a screenshot of my vimrc, from vim, within terminator:

enter image description here

As you can see, I haven't got the line

colorscheme solarized

So you could try taking that out - it finally seems to be working for me!

ps your screenshot doesn't look like it was taken from within terminator - unless we are talking about different terminators, of course.

以酷 2025-01-08 06:07:33

尝试将其添加到您的 .vimrc 文件中

let g:solarized_termcolors=16

屏幕截图中的其余设置都很好。

Try adding this to your .vimrc file

let g:solarized_termcolors=16

The rest of the settings in the screenshot are fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文