vim可以在Console2中使用时识别吗? [英] Can vim recognize when it is used in Console2?

查看:99
本文介绍了vim可以在Console2中使用时识别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过Console的史蒂文·哈曼(Steven Harman)的太阳能调整,我可以或多或少地使用已着色配色方案.但是偶尔我会通过香草cmd.exe窗口进入vim,并且Solarized 16色colorcheme与它对应的gui不一致.

With Steven Harman's Solarized tweak for Console2 I can more or less use the Solarized color scheme in win32 vim. But once in a while I find myself in vim via a vanilla cmd.exe window and the Solarized 16-color colorscheme is not aligned to it gui equivalent.

所以我想在vimrc中修复此问题,但是如何检查Console2中是否使用了控制台vim?

So I'd like to fix this inside my vimrc, but how can I check if console vim is being used in Console2?

谢谢!

推荐答案

在Console2中,您可以通过修改 shell 调用(从设置"对话框或直接在XML配置中)来设置任意环境变量. ).对于默认的Windows命令提示符,请使用以下值:

In Console2, you can set arbitrary environment variables by modifying the shell invocation (from the Settings dialog, or directly in the XML config). For the default Windows command prompt, use a value of:

cmd.exe /K set EMULATOR=console2

对于Cygwin Bash,类似这样的方法应该起作用:

For Cygwin Bash, something like this should work:

C:\cygwin\bin\bash.exe -c "export EMULATOR=console2; exec /bin/bash -i"

然后,根据romainl的回答,在您的.vimrc中的条件中检查$EMULATOR值.

Then, check for the $EMULATOR value in a conditional in your .vimrc, as outlined by romainl's answer.

这篇关于vim可以在Console2中使用时识别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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