【2021-11-08】Qt Creator 设置 Visual Studio 风格的语法高亮

打开目录

%userprofile%\AppData\Roaming\QtProject\qtcreator\styles

新建一个文件 VisualStudioDarkEnhanced.xml,内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="Visual Studio Dark Enhanced">
  <style name="Text" foreground="#ebebeb" background="#1e1e1e"/>
  <style name="Link"/>
  <style name="Selection" background="#264f78"/>
  <style name="LineNumber" foreground="#2b91af" background="#191919"/>
  <style name="SearchResult"/>
  <style name="SearchResultAlt1" foreground="#000033" background="#b6ccff"/>
  <style name="SearchResultAlt2" foreground="#330000" background="#ffb6cc"/>
  <style name="SearchScope"/>
  <style name="Parentheses"/>
  <style name="ParenthesesMismatch"/>
  <style name="AutoComplete"/>
  <style name="CurrentLine" background="#0f0f0f"/>
  <style name="CurrentLineNumber" foreground="#2b91af" bold="true"/>
  <style name="Occurrences"/>
  <style name="Occurrences.Unused"/>
  <style name="Occurrences.Rename"/>
  <style name="Number" foreground="#afd99c"/>
  <style name="String" foreground="#d69d85"/>
  <style name="Type" foreground="#3dcaac"/>
  <style name="Local" foreground="#9cdcfe"/>
  <style name="Parameter" foreground="#9a9a9a"/>
  <style name="Global"/>
  <style name="Field"/>
  <style name="Static" foreground="#b0df90"/>
  <style name="VirtualMethod" foreground="#dcdcaa" italic="true"/>
  <style name="Function" foreground="#dcdcaa"/>
  <style name="Keyword" foreground="#398ecf"/>
  <style name="PrimitiveType" foreground="#3a87d0"/>
  <style name="Operator"/>
  <style name="Overloaded Operator" foreground="#00677c"/>
  <style name="Punctuation"/>
  <style name="Preprocessor" foreground="#b853c1"/>
  <style name="Label"/>
  <style name="Comment" foreground="#57a64a"/>
  <style name="Doxygen.Comment" foreground="#006400"/>
  <style name="Doxygen.Tag" foreground="#5e7a71" bold="true"/>
  <style name="VisualWhitespace"/>
  <style name="QmlLocalId" italic="true"/>
  <style name="QmlExternalId" italic="true"/>
  <style name="QmlTypeId" foreground="#3dcaac"/>
  <style name="QmlRootObjectProperty" italic="true"/>
  <style name="QmlScopeObjectProperty" italic="true"/>
  <style name="QmlExternalObjectProperty" italic="true"/>
  <style name="JsScopeVar" italic="true"/>
  <style name="JsImportVar" italic="true"/>
  <style name="JsGlobalVar" italic="true"/>
  <style name="QmlStateName" italic="true"/>
  <style name="Binding" foreground="#b799b9"/>
  <style name="DisabledCode"/>
  <style name="AddedLine"/>
  <style name="RemovedLine"/>
  <style name="DiffFile"/>
  <style name="DiffLocation"/>
  <style name="DiffFileLine"/>
  <style name="DiffContextLine"/>
  <style name="DiffSourceLine"/>
  <style name="DiffSourceChar"/>
  <style name="DiffDestLine"/>
  <style name="DiffDestChar"/>
  <style name="LogChangeLine" foreground="#c00000"/>
  <style name="LogAuthorName" foreground="#007af4"/>
  <style name="LogCommitDate" foreground="#006600"/>
  <style name="LogCommitHash" foreground="#ff0000"/>
  <style name="LogCommitSubject"/>
  <style name="LogDecoration" foreground="#ff00ff"/>
  <style name="Warning" underlineColor="#ffbe00"/>
  <style name="WarningContext" underlineColor="#ffbe00"/>
  <style name="Error" underlineColor="#ff0000" underlineStyle="SingleUnderline"/>
  <style name="ErrorContext" underlineColor="#ff0000" underlineStyle="DotLine"/>
  <style name="Declaration" foreground="#dcdcaa"/>
  <style name="FunctionDefinition" foreground="#dcdcaa"/>
  <style name="OutputArgument" italic="true"/>
  <style name="LastStyleSentinel"/>
</style-scheme>

Guess you like

Origin blog.csdn.net/COFACTOR/article/details/121211381