VScode转Source Insight 字体 语法 配色

该文提供了将VScode设置成类似SourceInsight的语法高亮和字体颜色的方法。通过修改settings.json文件,包括自定义编辑器背景色、侧边栏颜色、活动栏颜色,以及关键字、注释、函数、变量等不同元素的颜色和样式,实现个性化编程环境。
摘要由CSDN通过智能技术生成

VScode转Source Insight 字体 语法 配色

效果图:

vscode
Source Insight

使用要点

使用前将[Visual Studio Light]替换成自己的主题名
复制到vscode的setting.josn文件的最外层{}
不要漏掉上一行的,


    "workbench.colorCustomizations": {
        "[Visual Studio Light]": {
            "editor.background": "#90EE90",// 90EE90  8ae496 背景色
            "sideBar.background": "#cbd6e5",//侧边色
            "activityBar.background": "#4682B4",//活动栏颜色
        },
    },
    "editor.tokenColorCustomizations": {
        "comments": "#808080", // 注释
        "keywords": "#FF00FF", // 关键字
        "functions": "#000080", // 函数名
        "variables": "#800080", // 变量名
        "numbers": "#ff0000", // 数字
        "types": "#008000", //  类型
        "strings": "#000000", // 字符串
        "[Visual Studio Light]": {
            "textMateRules": [
                {
                    "scope": [
                        "storage.type.class",//注释
                    ],
                    "settings": {
                        "foreground": "#2F4F4F",
                        "fontStyle": ""
                    }
                },
                {
                    "scope": [
                        "keyword.other",//其他关键字 typedef
                    ],
                    "settings": {
                        "foreground": "#ff00ff",
                        "fontStyle": ""
                    }
                },
                {
                    "scope": [
                        "keyword.control.directive", // 与宏相关的关键字
                        "punctuation.definition.directive",// 与宏相关的关键字符号 "#"
                    ],
                    "settings": {
                        "foreground": "#ff00ff",
                        "fontStyle": "bold"
                    }
                },
                {
                    "scope": [
                        "punctuation.separator.dot-access",//语法符号,视作关键字 符号 "."
                        "punctuation.separator.pointer-access",//语法符号,视作关键字 符号 "->"
                        "keyword.operator",//语法符号,视作关键字 运算符
                    ],
                    "settings": {
                        "foreground": "#ff00ff",
                        "fontStyle": ""
                    }
                },
                {
                    "scope": [
                        "entity.name.function", // 函数名
                        "keyword.operator.sizeof", // 库函数
                    ],
                    "settings": {
                        "foreground": "#000080",
                        "fontStyle": "bold"
                    }
                },
                {
                    "scope": [
                        "variable.parameter", // 形参,视作函数的一部分
                    ],
                    "settings": {
                        "foreground": "#000080",
                        "fontStyle": ""
                    }
                },
                {
                    "scope": [
                        "variable.other.global", //全局变量
                    ],
                    "settings": {
                        "foreground": "#800080",
                        "fontStyle": "bold"
                    }
                },
                {
                    "scope": [
                        "variable.other.local", // 局部变量
                        "variable.other.property", // 结构体的字段
                        "punctuation",//一般的标点符号
                    ],
                    "settings": {
                        "foreground": "#800080",
                        "fontStyle": ""
                    }
                },
                {
                    "scope": [
                        "entity.name.function.preprocessor", // 宏定义
                    ],
                    "settings": {
                        "foreground": "#ff0000",
                        "fontStyle": "bold"
                    }
                },
                {
                    "scope": [
                        "constant.numeric", // 数值
                        "variable.other.enummember"//枚举值
                    ],
                    "settings": {
                        "foreground": "#ff0000",
                        "fontStyle": "italic"
                    }
                },
                {
                    "scope": [
                        "storage.type.built-in.primitive.c", //自带的类型
                        "storage.type", // struct关键字
                        "storage.modifier", // const, static
                    ],
                    "settings": {
                        "foreground": "#008000",
                        "fontStyle": ""
                    }
                },
                {
                    "scope": [
                        "string"
                    ],
                    "settings": {
                        "foreground": "#000000",
                        "fontStyle": "",
                    }
                },
                {
                    "scope": [
                        "string.quoted.double.include",
                        "string.quoted.other.lt-gt.include", //头文件
                        "constant",
                    ],
                    "settings": {
                        "foreground": "#0000FF",
                        "fontStyle": ""
                    }
                },

            ],
        },
    },
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
### 回答1: VSCode 是一款功能强大的代码编辑器,而 Source Insight 是一款专业的代码阅读软件。要在 VSCode 中设置 Source Insight 的显示效果,需要进行以下步骤: 1. 首先,我们需要安装 VSCodeSource Insight。可以从官方网站下载它们,并按照提示安装到电脑上。 2. 打开 VSCode,点击左侧的扩展按钮,搜索并安装 "Source Insight" 扩展。这个扩展可以帮助 VSCodeSource Insight 进行集成。 3. 安装完成后,重新启动 VSCode。 4. 在 VSCode 中,点击 "文件" 菜单,选择 "首选项",再选择 "设置"。在搜索框中输入 "source insight",找到 "Source Insight: Executable Path" 选项。 5. 点击 "编辑 in settings.json" 按钮,将 Source Insight 的执行文件路径填入该选项。例如,如果安装在默认路径下,可填写 "C:\Program Files\Source Insight 4.0\SrcIns4.exe"。 6. 设置完路径后,保存并关闭设置文件。 7. 重新打开一个源代码文件,右键点击文件,选择 "Source Insight",再选择 "在 Source Insight 中打开"。VSCode 将会启动 Source Insight,并在顶部菜单中添加一个 Source Insight 的选项卡。 8. 在 Source Insight 中,可以根据个人需求设置字体、主题和布局等显示效果。可以通过点击 "菜单 - Options" 来进行相关设置调整。 以上是通过在 VSCode 中设置 Source Insight 的显示效果的方法。这样,我们就可以在 VSCode 中方便地编辑及查看代码,并享受到 Source Insight 提供的专业阅读功能。 ### 回答2: 要设置 VSCode 来显示 Source Insight 的效果,可以按照以下步骤进行操作: 第一步是在 VSCode 上安装适当的插件,以支持 Source Insight 的代码显示。在 VSCode 的扩展商店中,搜索并安装名为 "Source Insight" 的插件。 安装完成后,打开 VSCode,点击左侧的插件图标,找到 "Source Insight" 插件,点击它的设置按钮。 进入设置页面后,需要进行一些配置。首先,在 "Source Insight: Enabled" 选项中,将其设置为 true,以启用 Source Insight 插件。 接下来,找到 "Source Insight: Root Path" 选项,并将其设置为 Source Insight 的根目录的路径。这个路径是 Source Insight 安装的路径,一般是在 C 盘的 Program Files 文件夹下。 然后,在 "Source Insight: Font Family" 选项中,可以设置所需的字体样式。可以根据个人喜好,选择合适的字体。 最后,在 "Source Insight: Font Size" 选项中,可以设置代码的字体大小。同样,根据个人需要,选择一个适合的字体大小。 完成以上设置后,可以关闭设置页面,并重新打开一个源代码文件,即可在 VSCode 中看到 Source Insight 的显示效果了。代码高亮、函数跳等功能都会生效,使得开发和阅读代码更加便捷。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值