在 Gnu 屏幕中退出 vim 时,Vim Ruby 语法着色会弄乱终端颜色

发布于 2024-08-20 23:56:46 字数 222 浏览 3 评论 0原文

我启动 Gnu 屏幕并开始编辑带有语法着色的 Ruby 文件,并选择使用粗体和彩色背景(例如晚上)的 vim 颜色方案。然后我退出了vim。终端不会恢复到以前的样子,而是采用了我在 Vim 中使用的颜色方案的一些属性。

如果我在 Gnu 屏幕之外使用 vim,则不会发生这种情况。

有人也经历过这个吗?解决方法是什么?

我正在使用 Ubuntu Jaunty 和 GNOME 终端。

I fire up Gnu screen and start editing a Ruby file with syntax coloring on and choose a vim colorscheme that uses boldface and a colored background (e.g. evening). Then I quit vim. The terminal doesn't return to the way it was before, but takes on some of the properties of the colorscheme I was using in Vim.

This doesn't happen if I'm using vim outside of Gnu screen.

Has anyone experienced this too? What's the workaround?

I'm using Ubuntu Jaunty and the GNOME Terminal.

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

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

发布评论

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

评论(1

°如果伤别离去 2024-08-27 23:56:46

听起来就像您将 ~/.vimrc 中的 t_Co 设置为不正确的值时会发生什么。

如果是这种情况,您应该做的是确保在您的环境中正确设置 $TERM ,以便 Vim 自动知道它可以使用多少种颜色。在 ~/.vimrc 中手动设置 t_Co 永远不是正确的答案。

在 screen 内部,$TERM 应为 screenscreen-bce,具体取决于您的配置。如果您有正确的 terminfo 条目并且 screen 是为支持它而构建的,您还可以使用 screen-256color 或 screen-256color-bce。

Sounds like what happens when you set t_Co in your ~/.vimrc to a value that isn't correct.

If that is the case, what you should be doing instead is ensuring that $TERM is set properly in your environment so Vim automatically knows how many colors it can use. Manually setting t_Co in your ~/.vimrc is never the correct answer.

Inside screen, $TERM should be screen or screen-bce depending on your configuration. If you have the proper terminfo entries and screen was built to support it, you can also use screen-256color or screen-256color-bce.

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