需要帮助编辑 "Preferences.sublime-settings - User"

Need help editing "Preferences.sublime-settings - User"

好的...我是新手,所以请多关照:)

我正在尝试更改光标,但我不知道如何将“光标代码”添加到“主题代码”(monokai pro)。 “主题代码”在“游标代码”下方,如何同时使用才能成功?我只想改变光标。

如何添加这段代码(游标代码)

{
    "caret_extra_width": 5,
    "caret_style": "solid",
    "wide_caret": true
}

到此代码(主题代码)

{
    "author": "Chris Kempson",
    "color_scheme": "Packages/Theme - Monokai Pro/Monokai Pro.sublime-color-scheme",
    "globals":
    {
        "background": "var(blue5)",
        "caret": "var(white)",
        "foreground": "var(white)",
        "invisibles": "var(blue7)",
        "line_highlight": "var(blue)",
        "selection": "var(blue2)"
    },
    "ignored_packages":
    [
        "Vintage"
    ],
    "name": "Tomorrow Night - Blue",
    "rules":
    [
        {
            "foreground": "var(grey)",
            "name": "Comment",
            "scope": "comment, string.quoted.double.block.python"
        },
        {
            "foreground": "var(white)",
            "name": "Foreground, Operator",
            "scope": "keyword.operator.class, keyword.operator, constant.other, source.php.embedded.line"
        },
        {
            "foreground": "var(red3)",
            "name": "Variable, String Link, Regular Expression, Tag Name",
            "scope": "variable, support.other.variable, string.other.link, string.regexp, entity.name.tag, entity.other.attribute-name, meta.tag, declaration.tag"
        },
        {
            "foreground": "var(orange)",
            "name": "Number, Constant, Function Argument, Tag Attribute, Embedded",
            "scope": "constant.numeric, constant.language, support.constant, constant.character, variable.parameter, punctuation.section.embedded, keyword.other.unit"
        },
        {
            "foreground": "var(orange2)",
            "name": "Class, Support",
            "scope": "entity.name.class, entity.name.type.class, support.type, support.class"
        },
        {
            "foreground": "var(green)",
            "name": "String, Symbols, Inherited Class, Markup Heading",
            "scope": "string, constant.other.symbol, entity.other.inherited-class, markup.heading"
        },
        {
            "foreground": "var(blue6)",
            "name": "Operator, Misc",
            "scope": "keyword.operator, constant.other.color"
        },
        {
            "foreground": "var(white3)",
            "name": "Function, Special Method, Block Level",
            "scope": "entity.name.function, meta.function-call, support.function, keyword.other.special-method, meta.block-level"
        },
        {
            "foreground": "var(white2)",
            "name": "Keyword, Storage",
            "scope": "keyword, storage, storage.type, entity.name.tag.css"
        },
        {
            "background": "var(red2)",
            "foreground": "var(white)",
            "name": "Invalid",
            "scope": "invalid"
        },
        {
            "background": "var(white4)",
            "foreground": "var(white)",
            "name": "Separator",
            "scope": "meta.separator"
        },
        {
            "background": "var(white2)",
            "foreground": "var(white)",
            "name": "Deprecated",
            "scope": "invalid.deprecated"
        },
        {
            "foreground": "var(white)",
            "name": "Diff foreground",
            "scope": "markup.inserted.diff, markup.deleted.diff, meta.diff.header.to-file, meta.diff.header.from-file"
        },
        {
            "foreground": "var(yellow)",
            "name": "Diff insertion",
            "scope": "markup.inserted.diff, meta.diff.header.to-file"
        },
        {
            "foreground": "var(red)",
            "name": "Diff deletion",
            "scope": "markup.deleted.diff, meta.diff.header.from-file"
        },
        {
            "background": "var(blue4)",
            "foreground": "var(white)",
            "name": "Diff header",
            "scope": "meta.diff.header.from-file, meta.diff.header.to-file"
        },
        {
            "font_style": "italic",
            "foreground": "var(blue3)",
            "name": "Diff range",
            "scope": "meta.diff.range"
        },
        {
            "foreground": "var(red4)",
            "name": "diff.deleted",
            "scope": "markup.deleted"
        },
        {
            "foreground": "var(yellow2)",
            "name": "diff.inserted",
            "scope": "markup.inserted"
        },
        {
            "foreground": "var(purple)",
            "name": "diff.changed",
            "scope": "markup.changed"
        }
    ],
    "theme": "Agila.sublime-theme",
    "variables":
    {
        "blue": "#00346e",
        "blue2": "#003f8e",
        "blue3": "#3e999f",
        "blue4": "#4271ae",
        "blue5": "#002451",
        "blue6": "#99ffff",
        "blue7": "#404f7d",
        "green": "#d1f1a9",
        "grey": "#999999",
        "orange": "#ffc58f",
        "orange2": "#ffeead",
        "purple": "#967efb",
        "red": "#c82829",
        "red2": "#f99da5",
        "red3": "#ff9da4",
        "red4": "#f92672",
        "white": "#ffffff",
        "white2": "#ebbbff",
        "white3": "#bbdaff",
        "white4": "#bbdafe",
        "yellow": "#718c00",
        "yellow2": "#a6e22e"
    }
}

没有收到此错误消息:

Error trying to parse settings: Unexpected trailing characters in Packages/User/Preferences.sublime-settings

谢谢大家!

你所说的“游标代码”实际上是一些偏好。它们应该添加到您的用户首选项中(可通过右侧的 Preferences → Settings 获得)。不要删除已经存在的内容,只需遵循 JSON 的规则 - 在一行中以左大括号 { 开始,然后每行有一个首选项,并在末尾处使用逗号 ,每行的末尾,然后用大括号 } 结束。您可以根据需要设置任意多的首选项,不要仅限于这三个。查看左侧的默认首选项以获取可用的每个选项的列表。如果您不理解它们的全部含义,请不要担心 - 您几乎可以自定义 Sublime 的每一件事!

至于配色方案,您的下段代码就是这样 - 最简单的做法是从 Package Control 安装 Monokai Pro 并完全忽略该代码 - 它已损坏。如果您还没有安装 Package Control,请通过 selecting Tools → Install Package Control… 安装它。完成后,在 Windows/Linux、 上按 CtrlShiftPShiftP 在 macOS 上,打开命令面板。输入 pciPackage Control 的缩写:Install Package),点击 Enter,输入 monpro、select Theme - Monokai Pro,然后再次点击 Enter。您可能会在状态栏(window 的最底部)看到一条消息,说明正在安装。

安装后,select Preferences → Color Scheme…,滚动选项列表,点击 Monokai Pro,点击 Enter,你应该可以开始了。我知道这看起来有点复杂,但实际上并非如此。一旦安装了 Package Control,您就不必再次安装它(事实上 - 您 不能 再次安装它)。你还应该通过这个练习了解到所有 Sublime 模态菜单都有模糊搜索,所以你通常只需键入几个字母,你想要的选项就会立即弹出。