从命令行启动时MacVim颜色问题 [英] MacVim color issues when launching from command line

查看:112
本文介绍了从命令行启动时MacVim颜色问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Vim来说还比较陌生,到目前为止一直没有问题地使用它.我无论是从我的码头或使用从命令行启动的MacVim.这个伟大的工作,到目前为止,但刚才我碰到的一个问题.没有明显的原因,在命令行启动的MacVim开始创建了所有的颜色搞砸了的MacVim窗口.当我从码头启动它,一切都很好.

I'm relatively new to Vim and have been using it without issues so far. I'd either launch MacVim from my dock or using mvim from the command line. This worked great so far, but just now I've run into an issue. For no apparent reason, launching MacVim from the command line started to create a MacVim window that had all the colors screwed up. When I'd launch it from the dock, everything is fine.

在这里输入的图像描述"

在色彩方案既是编辑器(solarized)之间是相同的,所以我真的很困惑的问题是什么.我的MacVim使用自制安装的,它看起来像可执行文件是码头和命令行相同.我什至尝试直接启动/Applications/MacVim.app/Contents/MacOS/MacVim,它也会打开白色.我使用的剑锋,我已经尝试过的摧毁我的vim的和耙脚本重新创建它,但没有任何变化.

The colorscheme is the same between both editors (solarized), so I'm really puzzled as to what the issue is. My MacVim is installed using Homebrew, and it looks like the executable is the same for the dock and the command line. I've even tried launching /Applications/MacVim.app/Contents/MacOS/MacVim directly, it also opens up white. I'm using Janus, and I've tried nuking my .vim and recreating it with the rake script, but no change.

任何帮助不胜感激,谢谢提前.

Any help greatly appreciated, thank you in advance.

修改

我的/文件相当大,但他们来与杰纳斯的基本价值观.我/是相同的,并且看起来像这样,

My .vimrc/.gvimrc files are pretty large, but they're the basic values that come with Janus. My .vimrc.local/.gvimrc.local are the same and look like this,

syntax enable
set background=dark
colorscheme solarized
map f gg=G

我也发现,这似乎并没有为与像ir_black其他主题(其詹纳斯默认)中的问题.

I've also found that this doesn't seem to be a problem with other themes like ir_black (which Janus defaults to).

编辑2

这似乎是一个已知问题,提供至少其他几个人体验它.找到解决方案后将发布解决方案.

This seems to be a known issue with at least a few other people experiencing it. Will post a solution when one is found.

推荐答案

这是由终端环境导出到的MacVim引起的.

This is caused by mvim exporting the terminal environment to MacVim.

我如果它在Terminal.app运行已Solarized检查,如果是这样,使用透明(无)背景在vim避免一些奇怪的颜色问题.不幸的是我没有意识到mvim出口它的终端环境的MacVim为好.我以前问VIM检查$ TERM_PROGRAM值,如果它是terminal.app的字符串,然后我以为我是在它.我已经改变了这个到现在检查字符串和检查.

I have Solarized check if it's running in Terminal.app and, if so, use a transparent (NONE) background in vim to avoid some weird color issues. Unfortunately I didn't realize that mvim exports it's terminal environment to MacVim as well. I was previously asking vim to check the $TERM_PROGRAM value and if it was terminal.app's string then I assumed I was in it. I've changed this to now check the string and check.

应该的MacVim扔终端环境远?我不知道.我对此表示怀疑.因此,在使用vim脚本中的envrionment变量的情况下,如果与检查相关,还应检查gui_running,则我建议最佳实践.

Should MacVim throw the terminal environment away? I don't know. I doubt it. Thus I would recommend best practice in cases where one uses the envrionment variables in vim scripts would be to check for has gui_running as well, if relevant to the check.

我添加了一个定为这如提交于github上solarized项目d5fcacea的并在这里测试,并与一个其他用户远程地.

I've added a fix for this as of commit d5fcacea on the solarized project on github and tested here and with one other user remotely.

这篇关于从命令行启动时MacVim颜色问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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