codeblocks-ubuntu-change theme

參考:

http://blog.csdn.net/gzshun/article/details/8294305

http://www.cnblogs.com/platero/p/3518850.html


1. 導入主題到配置文件sudo gedit ~/.codeblocks/default.conf

2. find “colour_sets”,在<default></default>後添加你所需的主題。

例如添加下面的主題vim

<vim>  
			<NAME>  
			<str>  
			<![CDATA[vim]]>  
			</str>  
			</NAME>  
			<cc>  
			<style0>  
			<FORE>  
			<colour r="170" g="170" b="170" />  
			</FORE>  
			<BACK>  
			<colour r="0" g="0" b="0" />  
			</BACK>  
			<NAME>  
			<str>  
			<![CDATA[Default]]>  
			</str>  
			</NAME>  
			</style0>  
			<style1>  
			<FORE>  
			<colour r="170" g="170" b="170" />  
			</FORE>  
			<BACK>  
			<colour r="0" g="0" b="0" />  
			</BACK>  
			<NAME>  
			<str>  
			<![CDATA[Default]]>  
			</str>  
			</NAME>  
			</style1>  
			<style5>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Comment (normal)]]>  
			</str>  
			</NAME>  
			</style5>  
			<style6>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Comment (normal)]]>  
			</str>  
			</NAME>  
			</style6>  
			<style7>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Comment (normal)]]>  
			</str>  
			</NAME>  
			</style7>  
			<style8>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Comment (normal)]]>  
			</str>  
			</NAME>  
			</style8>  
			<style9>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Comment line (normal)]]>  
			</str>  
			</NAME>  
			</style9>  
			<style10>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Comment line (normal)]]>  
			</str>  
			</NAME>  
			</style10>  
			<style11>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<BOLD bool="0" />  
			<NAME>  
			<str>  
			<![CDATA[Comment (documentation)]]>  
			</str>  
			</NAME>  
			</style11>  
			<style12>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<BOLD bool="0" />  
			<NAME>  
			<str>  
			<![CDATA[Comment (documentation)]]>  
			</str>  
			</NAME>  
			</style12>  
			<style13>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<BOLD bool="0" />  
			<NAME>  
			<str>  
			<![CDATA[Comment line (documentation)]]>  
			</str>  
			</NAME>  
			</style13>  
			<style14>  
			<FORE>  
			<colour r="85" g="255" b="255" />  
			</FORE>  
			<BOLD bool="0" />  
			<NAME>  
			<str>  
			<![CDATA[Comment line (documentation)]]>  
			</str>  
			</NAME>  
			</style14>  
			<style19>  
			<FORE>  
			<colour r="255" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Number]]>  
			</str>  
			</NAME>  
			</style19>  
			<style20>  
			<FORE>  
			<colour r="255" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Number (inactive)]]>  
			</str>  
			</NAME>  
			</style20>  
			<style21>  
			<FORE>  
			<colour r="0" g="255" b="0" />  
			</FORE>  
			<BOLD bool="0" />  
			<NAME>  
			<str>  
			<![CDATA[Keyword]]>  
			</str>  
			</NAME>  
			</style21>  
			<style23>  
			<FORE>  
			<colour r="225" g="160" b="0" />  
			</FORE>  
			<BOLD bool="0" />  
			<NAME>  
			<str>  
			<![CDATA[User keyword]]>  
			</str>  
			</NAME>  
			</style23>  
			<style24>  
			<FORE>  
			<colour r="160" g="160" b="160" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[User keyword (inactive)]]>  
			</str>  
			</NAME>  
			</style24>  
			<style27>  
			<FORE>  
			<colour r="255" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[String]]>  
			</str>  
			</NAME>  
			</style27>  
			<style28>  
			<FORE>  
			<colour r="255" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[String]]>  
			</str>  
			</NAME>  
			</style28>  
			<style29>  
			<FORE>  
			<colour r="255" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[String (inactive)]]>  
			</str>  
			</NAME>  
			</style29>  
			<style30>  
			<FORE>  
			<colour r="255" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[String (inactive)]]>  
			</str>  
			</NAME>  
			</style30>  
			<style31>  
			<FORE>  
			<colour r="255" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Character]]>  
			</str>  
			</NAME>  
			</style31>  
			<style34>  
			<FORE>  
			<colour r="85" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Preprocessor]]>  
			</str>  
			</NAME>  
			</style34>  
			<style35>  
			<FORE>  
			<colour r="85" g="85" b="255" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Preprocessor (inactive)]]>  
			</str>  
			</NAME>  
			</style35>  
			<style36>  
			<FORE>  
			<colour r="160" g="160" b="160" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Operator]]>  
			</str>  
			</NAME>  
			</style36>  
			<style37>  
			<FORE>  
			<colour r="170" g="170" b="170" />  
			</FORE>  
			<NAME>  
			<str>  
			<![CDATA[Operator (inactive)]]>  
			</str>  
			</NAME>  
			</style37>  
			<style38>  
			<FORE>  
			<colour r="0" g="0" b="0" />  
			</FORE>  
			<BACK>  
			<colour r="170" g="170" b="170" />  
			</BACK>  
			<NAME>  
			<str>  
			<![CDATA[Selection]]>  
			</str>  
			</NAME>  
			</style38>  
			<style40>  
			<FORE>  
			<colour r="255" g="0" b="0" />  
			</FORE>  
			<BACK>  
			<colour r="0" g="0" b="0" />  
			</BACK>  
			<ITALICS bool="1" />  
			<NAME>  
			<str>  
			<![CDATA[Matching brace highlight]]>  
			</str>  
			</NAME>  
			</style40>  
			<editor>  
			<keywords>  
			<SET4>  
			<str>  
			<![CDATA[__cplusplus __GNUC__ __GNUG__]]>  
			</str>  
			</SET4>  
			</keywords>  
			</editor>  
			<NAME>  
			<str>  
			<![CDATA[C/C++]]>  
			</str>  
			</NAME>  
			</cc>  
</vim> 
插入到<default></default>後面即可,如果想直接將默認theme替換爲目標<vim>主題,不妨把<default></default>之間的內容替換未<vim></vim>之間的配置信息。

3. 待配置文件設置好後,啓動codeblocks來設置所需的主題。

settings->editor->syntax highlighting->colour theme來選擇,如果按上面設置應該會出現default和vim的選項,選擇所需即可。


4. 調整到黑色背景後,需要把光標顏色也改一下。

Setting-->Editor-->margins and caret-->caret   color

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章