Sublime Text 2 中每个标记的字体大小 [英] Per-token font size in Sublime Text 2

查看:32
本文介绍了Sublime Text 2 中每个标记的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人已经回答了这个问题,但我找不到任何重复项,我们深表歉意.

Apologies if this has already been answered but I couldn't find any duplicates.

是否可以在 Sublime Text 2 中基于每个令牌设置字体大小?例如,所有function"标记的大小为 10,而functionName"的大小为 30?我已经对我想要实现的目标做了一个粗略的模型:

Is it possible to set font sizes on a per-token basis in Sublime Text 2? For example, all 'function' tokens would be size 10 whereas 'functionName' would be size 30? I've put together a rough mock-up of what I want to achieve:

这里的动机是让您更容易专注于代码的重要部分——尤其是在略读时.我怀疑这样的事情应该是可能的,因为默认情况下,ST2 已经将不同的字体应用于不同的标记(例如 switchVars() 中的 'var' 与 'c = a;').

The motivation here is to make it easier for you to focus on the important parts of your code - especially when skimming. I would suspect that such a thing should be possible given that, by default, ST2 already applies different fonts to different tokens (e.g. 'var' vs. 'c = a;' in switchVars()).

如果不是功能,ST2 是否提供将其作为插件实现的能力?非常感谢!

If it is not a feature, does ST2 provide the ability to implement this as a plugin? Thanks a lot!

推荐答案

不幸的是,这是不可能的,因为 API 或用于在该粒度级别处理字体大小的配色方案.

Unfortunately, this is not possible, as there are no directives in the API or in color schemes for dealing with font size at that level of granularity.

但是,可以为您的配色方案(.tmTheme 文件)提供额外的突出显示,以便函数定义脱颖而出.看起来您正在使用 Monokai,因此打开 Packages/Color Scheme - Default/Monokai.tmTheme 并将以下内容添加到末尾,就在最终 </array> 之前代码>:

However, it is possible to provide additional highlighting to your color scheme (.tmTheme file) so that function definitions stand out. It looks like you're using Monokai, so open Packages/Color Scheme - Default/Monokai.tmTheme and add the following to the end, just before the final </array>:

        <dict>
            <key>name</key>
            <string>Function definition</string>
            <key>scope</key>
            <string>meta.function</string>
            <key>settings</key>
            <dict>
                <key>background</key>
                <string>#000080</string>
            </dict>
        </dict>

这将以深蓝色突出显示您的函数定义行:

This will highlight your function definition lines in a dark blue:

它也适用于替代函数定义语法:

It also works for alternate function definition syntaxes:

祝你好运!

这篇关于Sublime Text 2 中每个标记的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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