在Mac终端的vim语法突出显示中启用斜体 [英] Enabling italics in vim syntax highlighting for mac terminal

查看:258
本文介绍了在Mac终端的vim语法突出显示中启用斜体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让vim用斜体显示我的评论,并且我知道我需要放置

cterm=italic

hi Comment

我正在使用的color.vim文件中的

行.但是,这对文本显示没有影响,我怀疑这与某些Terminal.app设置有关,除非我误解了vim语法.如果有人可以向我展示如何启用此功能,我将不胜感激.

此外,我当前使用的是Monaco字体,该字体没有单独的斜体文件(但是,斜体语法高亮不适用于Consolas,Lucida,Bitstream Vera或其他启用斜体或斜体的字体).假设存在斜体字体的解决方案,我是否需要跳过任何其他步骤才能使Monaco正常工作?

感谢您的任何输入.


我很惊讶,我还没有得到答案.这似乎并不难做.也许是.或者,有人可以解释为什么这不可能是不可能的吗?

解决方案

从SnowLeopard开始,Terminal不支持斜体属性(SGR,值3).随时在 http://bugreporter.apple.com 上提交请求.

更新:斜体支持已添加到macOS Sierra 10.12的终端中.请注意,该版本的ncurses附带的xterm terminfo文件未声明斜体sitm功能.请参阅Bahman Eslami的答案 https://stackoverflow.com/a/53625973/754997 或cheon的答案中特定于vim的解决方法 https://stackoverflow.com/a/48512956/754997 用于创建声明sitm的terminfo文件.

I'd like to have vim display my comments in italics, and I understand I need to place

cterm=italic

in the

hi Comment

line in the color.vim file I'm using. This, however, is having no effect on the text display, which I suspect has to do with some Terminal.app setting, unless I'm misunderstanding the vim syntax. I'd appreciate if someone can show me how to enable this feature.

Additionally, I am currently using the Monaco font, which does not have a separate italic file (however, the italic syntax-highlighting doesn't work for Consolas, Lucida, Bitstream Vera or other italic- or oblique-enabled fonts either). Assuming that a solution exists for fonts with italics, do I have to jump through any further hoops to get Monaco working?

Thanks for any input.

EDIT:
I'm surprised I haven't gotten an answer yet; this doesn't seem like it should be too difficult to do. Maybe it is. Alternatively, could someone explain why this would not be possible?

解决方案

As of SnowLeopard, Terminal doesn’t support the italic attribute (SGR, value 3). Feel free to file a request at http://bugreporter.apple.com.

Update: Italic support was added to Terminal in macOS Sierra 10.12. Note that the xterm terminfo files included with that version of ncurses do not declare the italic sitm capability. See the vim-specific workaround in Bahman Eslami’s answer https://stackoverflow.com/a/53625973/754997 or cheon’s answer https://stackoverflow.com/a/48512956/754997 for creating a terminfo file that declares sitm.

这篇关于在Mac终端的vim语法突出显示中启用斜体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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