Mac OS X vim 颜色损坏

发布于 2024-09-17 20:54:59 字数 347 浏览 20 评论 0原文

这是我的设置

  • Mac OS X 10.6
  • VIM(OSX 10.6 附带的默认版本)
  • rails.vim(安装在 .vim/autoload 中)
  • ir_black.vim(安装在 .vim/colors 中)
  • 我有“colorscheme ir_black”和“syn on”现在

,当我进入终端并使用 vim 编辑 ruby​​ 文件时,我的颜色混乱了。仅显示几种颜色,有些文字甚至闪烁。我想知道 Rails.vim 语法突出显示和 ir_black 配色方案之间是否存在冲突?谁能帮我解决这个问题吗?我想使用 ir_black 配色方案。

Here's my setup

  • Mac OS X 10.6
  • VIM (default version that comes with OSX 10.6)
  • rails.vim (installed in .vim/autoload)
  • ir_black.vim (installed in .vim/colors)
  • i have "colorscheme ir_black" and "syn on" in ~/.vimrc

Now when I go into terminal and edit a ruby file with vim my colors are messed up. There are only a few colors showing up and some text is even blinking. I'm wondering if there's a conflict between rails.vim syntax highlighting and the ir_black color scheme? Can anyone help me fix this? I would like to use the ir_black color scheme.

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

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

发布评论

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

评论(7

烟织青萝梦 2024-09-24 20:54:59

Snow Leopard 中的 Mac OSX Terminal.app 不支持 ir_black 主题所需的 256 色(这是我使用的主题)。

下载并尝试类似 iTerm.app (http://iterm.sourceforge.net/),你应该'颜色没有问题。

或者您可以使用 MacVim (http://code.google.com/p/macvim/)

编辑:从 OSX 10.7 Lion 开始,内置 Terminal.app 现在支持 256 种颜色。请参阅下面 Chris Page 的评论,了解如何实现这一目标。

The Mac OSX Terminal.app in Snow Leopard does not support 256 colors, which is required for the ir_black theme (this is the theme I use).

Download and try something like iTerm.app (http://iterm.sourceforge.net/), and you shouldn't have a problem with colors.

Or you could use MacVim (http://code.google.com/p/macvim/)

Edit: As of OSX 10.7 Lion, the built in Terminal.app now supports 256 colors. See the comment below by Chris Page for how to achieve this.

走过海棠暮 2024-09-24 20:54:59

我一直在使用几乎相同的设置,除了 vim,它是我从 Macports 获取的。几年前,我发现了 ir_black 并喜欢它。我现在将它用于所有 vim 会话、Terminal.app 和 TextMate。让它与 Leopard 一起工作,然后 Snow Leopard 就有点做作了。但情况已经有所改善。按照此处的说明操作,让 Terminal.app 在 Snow Leopard 中看起来很棒< /a>.

I've been using a nearly identical setup, except for vim, which I grab from Macports. A few years ago I found ir_black and loved it. I now use it for all vim sessions, Terminal.app, and TextMate. Getting it to work with Leopard, and then Snow Leopard was a tad hokey. But things have improved. Follow the instructions here, Making Terminal.app look great in Snow Leopard.

软甜啾 2024-09-24 20:54:59

正如其他人提到的,ir_black 需要 256 种颜色,10.6.x 及更早版本的终端不支持该颜色。

从 Mac OS X Lion 10.7 开始,终端现在支持 256 种颜色,默认的 $TERM 值为 xterm-256colors。如果您升级到 Lion,ir_black 应该可以正常工作。

As mentioned by others, ir_black requires 256 colors, which is not supported by Terminal on 10.6.x and earlier.

As of Mac OS X Lion 10.7, Terminal now supports 256 colors and the default $TERM value is xterm-256colors. ir_black should work fine for you if you upgrade to Lion.

情栀口红 2024-09-24 20:54:59

测试您选择的终端中可以显示哪些颜色:
我刚刚在 vim.org 上找到了这个 perl 脚本,它转储了您的终端可能显示的 256 种颜色的列表...
http://www.vim.org/scripts/script.php?script_id=1349

on testing which colors can be displayed in your terminal of choice:
i just found this perl script on vim.org which dumps a list of 256 colors your terminal could possibly display...
http://www.vim.org/scripts/script.php?script_id=1349

挽手叙旧 2024-09-24 20:54:59

我一直在使用 iTerm,并惊讶地发现 Terminal.app 不支持 256 色!我推荐布莱恩的答案。

然而,如果你遇到这样的绑定,你可以将 $TERM 更改为 vt100 并且 vim 不会尝试使用颜色。在 bash(默认的 MacOSX shell)中,您可以使用以下命令进行设置:

export TERM='vt100'

I have been using iTerm and was shocked to find out Terminal.app doesn't support 256 colors! I recommend Bryan's answer.

However, if you ever get in a bind like this, you can change $TERM to vt100 and vim won't try to use colors. In bash (the default MacOSX shell) you set this with:

export TERM='vt100'
养猫人 2024-09-24 20:54:59

我在 Terminal.app 中使用 ir_black,但采用 16 色模式,看起来很棒。如果您确实更喜欢 256 色,我推荐 iTerm2。这些设置允许您将终端报告为“xterm-256”,这是在 Vim 中使用 256 色所需的。

检查这个网站的程序:
http://kevin.colyar.net/2011/01 /pretty-vim-color-schemes-in-iterm2

有一个基于 ir_black 的 Vim 主题,名为 tir_black,它更适合 256 种颜色:
http://www.vim.org/scripts/script.php?script_id=2777 !

看起来棒极了

iTerm2 还具有大量漂亮的功能。

我希望这有帮助。

I use ir_black in Terminal.app but in 16 color mode, and it looks great. If you really prefer 256 color, I recommend iTerm2. The settings allow you to have the terminal report itself as "xterm-256" which is what's needed to use 256 colors in Vim.

Check this website for the procedure:
http://kevin.colyar.net/2011/01/pretty-vim-color-schemes-in-iterm2

There is a ir_black-based Vim theme called tir_black which is better suited for 256 colors:
http://www.vim.org/scripts/script.php?script_id=2777

Looks awesome!

iTerm2 also has loads of nifty features.

I hope this helps.

鸠书 2024-09-24 20:54:59

我在使用 iTerm 时遇到了同样的问题,并通过转到“设置”> 解决了它。简介>终端>报告终端类型并将其设置为xterm-256color

I had the same issue with iTerm and solved it by going to Settings > Profile > Terminal > Report Terminal Type and setting it to xterm-256color.

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