简体   繁体   English

崇高的html标签主题

[英]Sublime html tag theming

I've been trying to color code sublime and one problem I can't figure out is how to get the symbol " < " and " > " to be any other color other than white. 我一直在尝试将代码升华,但是我无法弄清楚的一个问题是如何使符号“ <”和“>”成为除白色以外的任何其他颜色。 Any help appreciated 任何帮助表示赞赏

ex of problem : 例如:

In your key bindings search for this binding: 在您的键绑定中搜索以下绑定:

{ "keys": ["ctrl+alt+shift+p"], "command": "show_scope_name" },

Move your cursor to be just before the needed character (syntax constant or whatever it's called), in your case the < character and press the binding. 将光标移动到所需字符(语法常数或它所称的字符)的前面 ,如果是<字符,则按绑定。 Look at your status bar, it will show the corresponding syntax path mine currently is: 查看您的状态栏,它将显示当前对应的语法路径为:

text.html.basic meta.tag.script.html punctuation.definition.tag.begin.html

Then you need to edit your pen your theme file something.tmTheme and add the following definition: 然后,您需要编辑您的笔主题文件something.tmTheme并添加以下定义:

    <dict>
        <key>scope</key>
        <string>text.html.basic meta.tag.script.html punctuation.definition.tag.begin.html</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#00FF00</string>
        </dict>
    </dict>

That's it, now your < symbol is green as hell. 就是这样,现在您的<符号是绿色的。

Repeat the same process for the > symbol. >符号重复相同的过程。 Do this to style/recolor any other defined syntax. 这样做可以为其他定义的语法设置样式/重新着色。

Please note, that scope path may be different for .php files and .html files, and it IS different for XML 请注意,该范围的路径可能是不同的.php文件和.html文件,它 XML不同

There's a much easier way of styling < and > - just use punctuation.definition.tag and you're all set. 样式<>方式要简单得多-只需使用punctuation.definition.tag就可以了。 It works in HTML, XML, PHP, HTML5, etc., and since it covers both opening and closing tags you don't need to worry about changing two entries in your .tmTheme file should you decide to change the color. 它适用于HTML,XML,PHP,HTML5等,并且由于它同时包含了开始和结束标记,因此您无需担心在决定更改颜色的情况下更改.tmTheme文件中的两个条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM