当使用 PuTTy 作为客户端通过 ssh 使用 VIM 时,我一直试图让颜色方案在 VIM 中正常工作,但不幸的是我没有取得太大成功。即使我在 Putty 中启用了 256 种颜色并在 VIM 中设置 t_Co=256,我也只能使用 PuTTY 获得 8 位颜色。结果却没有达到应有的效果。我一直在尝试复制此设置 http://www.interworksinc.com/blogs/ckaukis/2009/06/03/vim-color-schemes-putty 但正如我所说,到目前为止这是徒劳的。
这里有人在 PuTTy 中使用 VIM 成功实现了配色方案吗?我很感激任何建议
谢谢,
帕特里克
[编辑]原来我已经找到了问题的根源。我在屏幕上使用 vim,它破坏了颜色。我想更新的问题是,是否可以在屏幕会话中使用工作颜色? [/编辑]
I've been trying to get colourschemes to work properly in VIM when using it over ssh with PuTTy as a client but unfortunately I haven't had much success. I can only get 8bit colours working with PuTTY even though I've enabled 256 colors in putty and set t_Co=256 in VIM. They don't turn out as they should. I've been trying to replicate this setup http://www.interworksinc.com/blogs/ckaukis/2009/06/03/vim-color-schemes-putty but as I say it's been in vain so far.
Has anyone here had success with colourschemes working with VIM in PuTTy? I'd appreciate any advice
Thanks,
Patrick
[EDIT] Turns out I've found the source of the problem. I was using vim in a screen which was breaking the colours. Updated question I guess is, is it possible to have working colors in a screen session? [/EDIT]
发布评论
评论(4)
我在 Putty 中遇到了黑色背景的问题:默认颜色的黑色背景上的蓝色字符很难阅读:
下启用“系统颜色
为了获得更好的对比度,我的解决方案是在“设置/窗口/颜色/使用系统颜色”
” 复选框显示 Putty 屏幕,白底黑字。不时髦但可读:-)
I had trouble with black background in Putty: blue characters on a black background with default colours are hard to read:
My solution for a better contrast was to enable "system colors" checkbox unter
"Settings / Window / Colours / Use system colors"
This displays the Putty screen with black characters on a white background. Not hip but readable :-)
除了编译支持之外,可能还需要向 screenrc 添加一些配置(我需要)。
http://www.frexx.de/xterm-256-notes/ 有一个很好的指导。要筛选的相关部分:
As well as compiled support, it may be necessary to add some config to screenrc (I needed to).
http://www.frexx.de/xterm-256-notes/ has a good guide. The relevant part to screen:
是的,您可以使用屏幕执行 256 色,但是,通常不会编译此选项。只需自行编译屏幕:
或者,您可以获得 选项卡式 PuTTy。它的优点是 ctrl-a 可以转到行首,并让您免于许多 termcap 的麻烦。但是,如果您想从多个终端重新连接到 screen 会话,那么确实没有什么比 screen 更好的了。
注意。这个问题可能属于超级用户。
Yes, you can do 256 colours with screen, however, this option usually isn't compiled in. Simply compile screen yourself with:
Alternatively, you could get a tabbed PuTTy. It has the advantage of ctrl-a going to the beginning of the line, and saves you from many termcap headaches. However, if you like to reconnect to your screen sessions from multiple terminals, there really isn't anything better than screen for the job.
NB. This question probably belongs on Superuser.
我在 Mac OS 上遇到了同样的问题,尝试了一些解决方案,但所有测试都显示 256 色未显示。之后我安装了brew的屏幕,一切都很好。也许是因为
/usr/bin/
中的 Mac OS 默认屏幕是在没有--enable-colors256
标志的情况下编译的。Mac 操作系统解决方案:
brew 安装屏幕
I had same problem on Mac Os, tried some solutions but all tests show that 256 colors not displayed. After that I'm installed screen from brew and all works great. Maybe it's because Mac Os default screen from
/usr/bin/
compiled without--enable-colors256
flag.Solution for mac os:
brew install screen