修改Visual Studio Code编辑器的主题和代码颜色
摘要:自定义Visual Studio Code(VSCode)的主题和代码颜色
在VS Code 的左下角,点击设置。
打开设置后,在搜索栏搜索关键字:主题。
搜索结果显示有许多个在setting.json中编辑,任意点开一个,即可编辑代码的颜色。
在文件setting.json的代码后面,插入相应的代码,然后保存。
代码如下:
// 自定义的颜色"editor.tokenColorCustomizations": {"comments": "#55aa7f", // 注释"keywords": "#ff55ff", // 关键字"variables": "#a792e2", // 变量名 "strings": "#00ff7f", // 字符串"functions": "#ffff00", // 内置函数名"numbers": "#00eeff", // 数字"types": "#55bbff", //类定义颜色},
你会发现编辑器里的代码颜色随之改变了。
发现引号的颜色,还是不太喜欢,于是又找了许久资料,继续折腾。
//文本匹配规则后面的代码,会覆盖前面的颜色设置代码。
// 自定义的颜色"editor.tokenColorCustomizations": {"comments": "#55aa7f", // 注释"keywords": "#ff55ff", // 关键字"variables": "#5eccf8", // 变量名 函数的参数名 "strings": "#00ff7f", // 字符串"functions": "#ffbb00", // 自定义及内置的函数名称 如:print"numbers": "#00eeff", // 数字"types": "#55bbff", //类定义颜色//文本匹配规则"textMateRules": [//entity.name.function", //直接调用的函数//entity.name.type", //typedef定义的变量//keyword.control", //if switch break return//keyword.operator.assignment", // =等号/赋值号 |= &=//"keyword.operator.logical", //逻辑符号 && || !//"constant.character.escape", //"\r\n"\//constant.other.placeholder", //"%s %c"//punctuation.definition.comment", // // /*注释开头//constant.numeric", //数字:50 10 0x20的20部分//keyword.operator.word //and or not//"scope":"meta", //括号 函数声明的括号 调用的括号...//punctuation.separator", //冒号 逗号//punctuation.terminator", //分号//storage.modifier", //static const//string.quoted.single", //单引号字符串//string.quoted.double", //双引号字符串//string.quoted.triple", //三引号字符串//"storage.type", //void int char //"punctuation.definition.string.begin", //左双引号//"punctuation.definition.string.end", //右双引号//##########################################################################//系统内置的函数名称的颜色 如:print len {"scope": "support.function","settings": {"foreground": "#ffbb00",}},//类的名称颜色 如class abc() 中的abc{"scope": "entity.name.type", //函数和类的名称颜色"settings": {"foreground": "#14fff3",}},//类和函数的定义单词颜色 def class{"scope": "storage.type", //void int char "settings": {"foreground": "#ff00c8",}},//不知道是什么{"scope": "storage.modifier", //static const"settings": {"foreground": "#ffe600de",}},//运算符号,如 +-*/={"scope": "keyword.operator", //=等号/赋值号 |= &="settings": {"foreground": "#ff55ff",}},// 系统的控制关键词:如 if pass return f{"scope": "keyword.control", //if switch break return"settings": {"foreground": "#ff00c8","fontStyle": ""}},//逻辑符号:如 and or {"scope": "keyword.operator.logical", //逻辑符号 && || !"settings": {"foreground": "#ff00c8","fontStyle": ""}},//换行符、转义符等如 :\r \n{"scope": "constant.character.escape", //"\r\n""settings": {"foreground": "#ee5050","fontStyle": ""}},//不知道是什么{"scope": "variable.other", //结构体对象和成员等"settings": { //VSCode使用C的颜色限制,这一点比较坑"foreground": "#4f1eff", //比如Public.Delay(),颜色是一起变得"fontStyle": "" //不能单独设置Public和Delay的显示颜色} //可能因为VS Code主要用于前端,对C的支持不够完善},//函数的参数名称{"scope": "variable.parameter", //函数参数-定义阶段"settings": {"foreground": "#5eccf8","fontStyle": ""}},{"scope": "entity.name.section", //函数参数-调用阶段"settings": {"foreground": "#ff0000","fontStyle": ""}},// 左单双引号{"scope": "punctuation.definition.string.begin","settings": {"foreground": "#00ff7f","fontStyle": "bold"}},//右单双引号{"scope": "punctuation.definition.string.end","settings": {"foreground": "#00ff7f","fontStyle": "bold" //加粗}},{"scope": ["constant.other.symbol",],"settings": {"foreground": "#ff0000"}}]},
现在变成了这样子:
成功修改了引号的颜色。但是True、None等系统保留字还是不知道怎么修改。
先这样吧,基本可用了!
对我而言,颜值第一,赏心悦目的重要性,永远靠前!
修改Visual Studio Code编辑器的主题和代码颜色相关推荐
- 『C/C++养成计划』Visual Studio Code编辑器配置(外观通用型扩展Minmal)
Visual Studio Code编辑器配置(外观&通用型扩展&Minmal)! 文章目录 一. vscode配置外观|通用型扩展 1.1. 色彩主题配置扩展(GitHub Them ...
- 如何折叠Visual Studio Code for Windows中的代码部分?
本文翻译自:How do I collapse sections of code in Visual Studio Code for Windows? How do I fold or collaps ...
- vscode打开html中文乱码,Visual Studio Code 1.44 解决中文代码显示乱码问题(小白图文教程)...
现今主流的计算机中文字符编码方案是:GBK和UTF-8. 不同编码方案使用不同的字符集,GBK字符集在中文字符长度和字符数量上存在绝对优势,但对国外字符并不支持.所以,完全面向国内的程序/网页使用的是 ...
- Visual Studio Code 编辑器使用
image.png 之前一直都是用 sublime text 作为开发工具,用久了自然而然会觉得生活无趣,而且当时用sublime text 装了很多插件,有些插件不能用,于是决定试试微软的新产品 V ...
- ubuntu14.04 LTS Visual Studio Code 编辑器推荐
除了ubuntu geany (茶壶图标) 这个一直爱好的编辑器,发现一个新的编辑器"Visual Studio Code",也是很好用,记录下 https://code.visu ...
- Visual Studio Code 编辑器 使用入门
目录 为什么使用 VS Code VS Code 安装 launch.json 简介 使用VS Code 开发 Javascript 安装Script插件 调试Script 如何设置成中文 为什么使 ...
- 介绍一个修改 Visual Studio Code 侧边框颜色的扩展 Peacock
日复一日在 Visual Studio Code 里编辑代码,你是否对其一成不变的侧边框颜色厌倦了呢? https://www.peacockcode.dev/guide/#overview 那就试试 ...
- 修改Visual Studio Code的自定义键盘快捷键
很多IDE,比如Eclipse和Visual Studio Code的auto completion的Intellisense快捷键都是Ctrl + Space,正好和国内开发者切换中英文输入法的案件 ...
- 在 Mac中使用visual studio code 调试 C,C++代码
在 Mac上有时候需要编写一些 C 或者 C++的代码,如果使用 xcode,有时候就显得很笨重,而且运行起来很不方便.而微软提供了一个跨平台的编辑器 Visual studio code ,这个编辑 ...
最新文章
- 判断线程是否执行完毕_Java并发编程 | 线程核心机制,基础概念扩展
- Linux_进程管理计划任务
- Oracle在Linux平台“静默”安装(二)
- JavaScript 字符串连接性能比较
- Android自定义progressBar
- 数据库无法保存中文的解决
- ubuntu 下安装qemu
- Android 系统性能优化(22)---dumpsys的使用
- 大数据之-Hadoop_1.x和2.x区别---大数据之hadoop工作笔记0012
- mysql log error_MySQL日志之error_log
- 怎么在Guitar Pro乐谱中加入哇音
- 2006 年100 款最佳安全工具谱
- Transcad转Ptv Visum的学习之路
- 极值点、驻点、拐点的区别和联系
- 文具行业APS解决方案
- Attention is all you need 论文精读笔记 Transformer
- cerr与cout的区别
- 操作系统 第五章虚拟器存储器(自我总结式)
- python面试题总结
- Scala 环境搭建安装配置