由于短期内重装系统较为频繁,每次重装之后要重新装一次codeblocks,配置又得重新来一次,步骤略多,在这里记录一下留一个备份。
配置过程:
- 安装Codeblocks 16.01及以上版本
- 首次运行,并建立一个新project,保存关闭
- 配置文件在C:\Users\Sun\AppData\Roaming\CodeBlocks,文件名为default.conf
- 用新的配置文件(约95k)替换它
- 重新打开cb,Settings-Editor-Syntax Highlighting,color theme选为modnokai coffee,其它项一般不用改
- Settings-Enviornment-Colours,修改以下几项
Editor:Line numbers background colour 自定义颜色(39,40,34)
Editor:Line numbers foreground colour 默认颜色灰色
Editor:Margin chrome colour 自定义颜色(39,40,34)
Editor:Margin chrome highlight colour 自定义颜色(39,40,34)
其中(39,40,34)是代码界面背景颜色的RGB值,这样保持全界面颜色一致
拿来替换的default.conf文件内容,覆盖源文件即可:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CodeBlocksConfig version="1">
<editor>
<colour_sets>
<ACTIVE_COLOUR_SET>
<str><![CDATA[modnokai night shift v2]]></str>
</ACTIVE_COLOUR_SET>
<ACTIVE_LANG>
<str><![CDATA[C/C++]]></str>
</ACTIVE_LANG>
<bright_yellow>
<NAME>
<str><![CDATA[bright yellow]]></str>
</NAME>
<cc>
<style0>
<BACK>
<colour r="255" g="255" b="208" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style0>
<style1>
<BACK>
<colour r="255" g="255" b="208" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style1>
<style5>
<FORE>
<colour r="158" g="158" b="158" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style5>
<style6>
<FORE>
<colour r="158" g="158" b="158" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style6>
<style7>
<FORE>
<colour r="158" g="158" b="158" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style7>
<style8>
<FORE>
<colour r="158" g="158" b="158" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style8>
<style9>
<FORE>
<colour r="128" g="128" b="128" />
</FORE>
<NAME>
<str><![CDATA[Comment line (normal)]]></str>
</NAME>
</style9>
<style10>
<FORE>
<colour r="128" g="128" b="128" />
</FORE>
<NAME>
<str><![CDATA[Comment line (normal)]]></str>
</NAME>
</style10>
<style11>
<FORE>
<colour r="128" g="128" b="218" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment (documentation)]]></str>
</NAME>
</style11>
<style12>
<FORE>
<colour r="128" g="128" b="218" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment (documentation)]]></str>
</NAME>
</style12>
<style13>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment line (documentation)]]></str>
</NAME>
</style13>
<style14>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment line (documentation)]]></str>
</NAME>
</style14>
<style21>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Keyword]]></str>
</NAME>
</style21>
<style23>
<BOLD bool="0" />
<NAME>
<str><![CDATA[User keyword]]></str>
</NAME>
</style23>
<style39>
<BACK>
<colour r="0" g="255" b="0" />
</BACK>
<NAME>
<str><![CDATA[Active line]]></str>
</NAME>
</style39>
<NAME>
<str><![CDATA[C/C++]]></str>
</NAME>
<editor>
<keywords />
</editor>
</cc>
</bright_yellow>
<dark_gray>
<NAME>
<str><![CDATA[dark gray]]></str>
</NAME>
<cc>
<style0>
<FORE>
<colour r="255" g="255" b="255" />
</FORE>
<BACK>
<colour r="42" g="56" b="54" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style0>
<style1>
<FORE>
<colour r="255" g="255" b="255" />
</FORE>
<BACK>
<colour r="42" g="56" b="54" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style1>
<style13>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment line (documentation)]]></str>
</NAME>
</style13>
<style14>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment line (documentation)]]></str>
</NAME>
</style14>
<style19>
<FORE>
<colour r="255" g="142" b="255" />
</FORE>
<NAME>
<str><![CDATA[Number]]></str>
</NAME>
</style19>
<style21>
<FORE>
<colour r="140" g="196" b="255" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Keyword]]></str>
</NAME>
</style21>
<style23>
<FORE>
<colour r="255" g="230" b="80" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[User keyword]]></str>
</NAME>
</style23>
<style27>
<FORE>
<colour r="255" g="128" b="0" />
</FORE>
<NAME>
<str><![CDATA[String]]></str>
</NAME>
</style27>
<style28>
<FORE>
<colour r="255" g="128" b="0" />
</FORE>
<NAME>
<str><![CDATA[String]]></str>
</NAME>
</style28>
<style34>
<FORE>
<colour r="115" g="210" b="22" />
</FORE>
<NAME>
<str><![CDATA[Preprocessor]]></str>
</NAME>
</style34>
<style36>
<FORE>
<colour r="255" g="0" b="128" />
</FORE>
<NAME>
<str><![CDATA[Operator]]></str>
</NAME>
</style36>
<style38>
<BACK>
<colour r="128" g="128" b="128" />
</BACK>
<NAME>
<str><![CDATA[Selection]]></str>
</NAME>
</style38>
<style39>
<BACK>
<colour r="64" g="128" b="128" />
</BACK>
<NAME>
<str><![CDATA[Active line]]></str>
</NAME>
</style39>
<NAME>
<str><![CDATA[C/C++]]></str>
</NAME>
<editor>
<keywords />
</editor>
</cc>
</dark_gray>
<idel>
<NAME>
<str><![CDATA[idel]]></str>
</NAME>
<cc>
<style0>
<BACK>
<colour r="245" g="245" b="245" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style0>
<style1>
<BACK>
<colour r="245" g="245" b="245" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style1>
<style5>
<FORE>
<colour r="135" g="135" b="135" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style5>
<style6>
<FORE>
<colour r="135" g="135" b="135" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style6>
<style7>
<FORE>
<colour r="135" g="135" b="135" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style7>
<style8>
<FORE>
<colour r="135" g="135" b="135" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style8>
<style9>
<FORE>
<colour r="135" g="135" b="135" />
</FORE>
<NAME>
<str><![CDATA[Comment line (normal)]]></str>
</NAME>
</style9>
<style10>
<FORE>
<colour r="135" g="135" b="135" />
</FORE>
<NAME>
<str><![CDATA[Comment line (normal)]]></str>
</NAME>
</style10>
<style11>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment (documentation)]]></str>
</NAME>
</style11>
<style12>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment (documentation)]]></str>
</NAME>
</style12>
<style21>
<FORE>
<colour r="255" g="128" b="64" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Keyword]]></str>
</NAME>
</style21>
<style23>
<FORE>
<colour r="156" g="37" b="166" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[User keyword]]></str>
</NAME>
</style23>
<style27>
<FORE>
<colour r="0" g="155" b="45" />
</FORE>
<NAME>
<str><![CDATA[String]]></str>
</NAME>
</style27>
<style28>
<FORE>
<colour r="0" g="155" b="45" />
</FORE>
<NAME>
<str><![CDATA[String]]></str>
</NAME>
</style28>
<style34>
<FORE>
<colour r="0" g="128" b="255" />
</FORE>
<NAME>
<str><![CDATA[Preprocessor]]></str>
</NAME>
</style34>
<style39>
<BACK>
<colour r="0" g="255" b="0" />
</BACK>
<NAME>
<str><![CDATA[Active line]]></str>
</NAME>
</style39>
<NAME>
<str><![CDATA[C/C++]]></str>
</NAME>
<editor>
<keywords />
</editor>
</cc>
</idel>
<oblivion>
<NAME>
<str><![CDATA[oblivion]]></str>
</NAME>
<cc>
<style0>
<FORE>
<colour r="238" g="238" b="236" />
</FORE>
<BACK>
<colour r="46" g="52" b="54" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style0>
<style1>
<FORE>
<colour r="238" g="238" b="236" />
</FORE>
<BACK>
<colour r="46" g="52" b="54" />
</BACK>
<NAME>
<str><![CDATA[Default]]></str>
</NAME>
</style1>
<style5>
<FORE>
<colour r="136" g="138" b="133" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style5>
<style6>
<FORE>
<colour r="136" g="138" b="133" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style6>
<style7>
<FORE>
<colour r="136" g="138" b="133" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style7>
<style8>
<FORE>
<colour r="136" g="138" b="133" />
</FORE>
<NAME>
<str><![CDATA[Comment (normal)]]></str>
</NAME>
</style8>
<style11>
<FORE>
<colour r="52" g="101" b="164" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment (documentation)]]></str>
</NAME>
</style11>
<style12>
<FORE>
<colour r="52" g="101" b="164" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Comment (documentation)]]></str>
</NAME>
</style12>
<style17>
<FORE>
<colour r="164" g="0" b="0" />
</FORE>
<NAME>
<str><![CDATA[Comment keyword error (documentation)]]></str>
</NAME>
</style17>
<style18>
<FORE>
<colour r="164" g="0" b="0" />
</FORE>
<NAME>
<str><![CDATA[Comment keyword error (documentation)]]></str>
</NAME>
</style18>
<style19>
<FORE>
<colour r="173" g="127" b="168" />
</FORE>
<BACK>
<colour r="46" g="52" b="54" />
</BACK>
<BOLD bool="1" />
<NAME>
<str><![CDATA[Number]]></str>
</NAME>
</style19>
<style21>
<FORE>
<colour r="233" g="185" b="110" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[Keyword]]></str>
</NAME>
</style21>
<style23>
<FORE>
<colour r="78" g="154" b="6" />
</FORE>
<BOLD bool="0" />
<NAME>
<str><![CDATA[User keyword]]></str>
</NAME>
</style23>
<style27>
<FORE>
<colour r="185" g="49" b="0" />
</FORE>
<BACK>
<colour r="30" g="3" b="0" />
</BACK>
<NAME>
<str><![CDATA[String]]></str>
</NAME>
</style27>
<style28>
<FORE>
<colour r="185" g="49" b="0" />
</FORE>
<BACK>
<colour r="30" g="3" b="0" />
</BACK>
<NAME>
<str><![CDATA[String]]></str>
</NAME>
</style28>
<style31>
<FORE>
<colour r="245" g="121" b="0" />
</FORE>
<NAME>
<str><![CDATA[Character]]></str>
</NAME>
</style31>
<style33>
<FORE>
<colour r="211" g="215" b="207" />
</FORE>
<NAME>
<str><![CDATA[UUID]]></str>
</NAME>
</style33>
<style34>
<FORE>
<colour r="78" g="154" b="6" />
</FORE>
<NAME>
<str><![CDATA[Preprocessor]]></str>
</NAME>
</style34>
<style36>
<FORE>
<colour r="233" g="185" b="110" />
</FORE>
<NAME>
<str><![CDATA[Operator]]></str>
</NAME>