python - Sublime Text Editor 3 - 主题化 - 更改文档字符串颜色

标签 python themes sublimetext sublimetext3

我正在使用 Sublime Text Editor 3 for Linux。我用它来编写Python代码。我希望能够将文档字符串的颜色更改为另一种颜色,而不更改常规注释的颜色(#)。我查看了 .tmTheme 文件,但在其中找不到有关文档字符串颜色的任何内容。然而,有一个主题显然有两种不同的颜色用于文档字符串和常规注释。

enter image description here

如何修改主题以使文档字符串和注释具有两种不同的颜色?

最佳答案

我开发了 Neon Color SchemePython Improved语言定义专门使 Python 以及尽可能多的其他语言看起来尽可能好,具有尽可能多的范围。它还包括不同颜色的文档字符串和注释:

Neon and Python Improved

以下是 .tmTheme 文件中文档字符串的条目:

<dict>
    <key>name</key>
    <string>docstring</string>
    <key>scope</key>
    <string>string.quoted.double.block, string.docstring, string.quoted.single.block</string>
    <key>settings</key>
    <dict>
        <key>fontStyle</key>
        <string>italic</string>
        <key>foreground</key>
        <string>#218B97</string>
    </dict>
</dict>

以及常规评论:

<dict>
    <key>name</key>
    <string>Comment</string>
    <key>scope</key>
    <string>comment</string>
    <key>settings</key>
    <dict>
        <key>fontStyle</key>
        <string>italic</string>
        <key>foreground</key>
        <string>#7F817E</string>
    </dict>
</dict>

而且,如果您想让引号突出:

<dict>
    <key>name</key>
    <string>String Quotes</string>
    <key>scope</key>
    <string>string.quoted punctuation.definition.string.begin, string.quoted punctuation.definition.string.end</string>
    <key>settings</key>
    <dict>
        <key>fontStyle</key>
        <string>italic</string>
        <key>foreground</key>
        <string>#FF07A2</string>
    </dict>
</dict>

关于python - Sublime Text Editor 3 - 主题化 - 更改文档字符串颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21648753/

相关文章:

python - Django:顶级项目文件夹 = root(好听的短名称),非顶级项目文件夹 = ? (需要好听的短名)

python - 如何打包一个django项目?

python - 安装 jupyter 主题后,笔记本和 docker 容器不再工作

regex - 如何组合正则表达式中的行?

sublimetext2 - 在 Sublime Text 2 中为不同文件类型设置默认语法

python - OR 运算符内的 OR 运算符 - RegEX

python - 当它们都共享相同的日期时获取列中值最高的行?

php - 如何在主题中包含 Redux 框架

android - DatePickerDialog 和 Theme.MaterialComponents

go - 在 Sublime Text 3 中运行 Golang 项目