VSCode에서 테마와 코드 색상을 사용자 정의하는 방법
Dec 10, 2021 pm 07:04 PMVSCode편집기의 테마와 코드 색상을 어떻게 맞춤설정하나요? 다음 글에서는 테마와 코드 색상을 수정하는 방법을 소개하겠습니다. 도움이 되셨으면 좋겠습니다!
VS Code의 왼쪽 하단에서 설정을 클릭합니다.
설정을 연 후 검색창에 테마 키워드를 검색하세요.
검색 결과에 따르면 settings.json에 수정 사항이 많이 있습니다. 코드 색상을 수정하려면 하나를 클릭하세요. [추천 학습: "vscode 입문 튜토리얼"]
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 등 시스템 예약어를 수정하는 방법은 아직 모르겠습니다.
지금은 이렇게 합시다. 이제 기본적으로 사용할 준비가 되었습니다!
저에게는 외모가 우선이고 눈을 즐겁게 하는 것이 항상 최우선입니다!
VSCode에 대한 자세한 내용을 보려면 vscode 튜토리얼을 방문하세요! !
위 내용은 VSCode에서 테마와 코드 색상을 사용자 정의하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

인기 기사

인기 기사

뜨거운 기사 태그

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











vscode에서 word 문서 보는 방법 vscode에서 word 문서 보는 방법

vscode로 순서도 그리는 방법 Visual_studio 코드로 순서도 그리는 방법

Vscode에서 Maude를 작성하는 방법_Vscode에서 Maude를 작성하는 방법

Caltech Chinese는 AI를 사용하여 수학적 증명을 뒤집습니다! 충격적인 Tao Zhexuan의 속도 5배 향상, 수학 단계의 80%가 완전 자동화됨

vscode에서 백그라운드 업데이트를 활성화하는 방법 vscode에서 백그라운드 업데이트를 활성화하는 방법

vscode 작업 공간에 파일을 추가하는 방법 vscode 작업 공간에 파일을 추가하는 방법

vscode에서 wsl 구성 파일을 비활성화하는 방법 vscode에서 wsl 구성 파일을 비활성화하는 방법

VScode에서 애니메이션 부드러운 삽입을 설정하는 방법 VScode 튜토리얼에서 애니메이션 부드러운 삽입을 설정하는 방법
