--- tags: 軟體工具, CodeBlocks --- # Code::Blocks主題變更設置 CodeBlocks預設為白底的淺色主題,寫程式時覺得比較刺眼,雖然不能把整個介面改成深色主題,但最主要的編輯器區塊是可以更改配色的。 ## 最終效果 ![最終效果][img-1] 這個主題是我自行設置,主要仿照Visual Studio Code的配色,再搭配幾個官方Sublime主題的設定。 ## 更改步驟 1. CodeBlocks至少要先打開過一次,讓`default.conf`這個檔案產生。 2. 到[官方Wiki的主題頁面][link-1],找到**Installation**區塊,複製框框裡的xml內容到記事本,存成`.conf`檔。 或是下載我做的[`colour_themes.conf`][link-2],裡面包含官方的Son of Obsidian和Sublime主題,以及我自行設置的VS Code主題。 [link-1]: http://wiki.codeblocks.org/index.php?title=Syntax_highlighting_custom_colour_themes [link-2]: https://drive.google.com/uc?export=download&id=14jJmpj4mxg9e-kpUV-a1Yylf3ugpJpCe 3. 確保CodeBlocks已關閉,備份`default.conf`。 檔案路徑:`C:\Users\{username}\AppData\Roaming\codeblocks\default.conf` 4. 打開CodeBlocks安裝目錄中的`cb_share_config.exe`,Source configuration file選擇`colour_themes.conf`,Destination configuration file選擇`default.conf`。勾選想要的主題後,依序點擊Transfer和Save按鈕,這樣主題設置就寫入`default.conf`了。 ![CodeBlocks Share Config][img-2] 5. 打開CodeBlocks,在Settings→Editor→左側Syntax highlighting,可以看到主題已成功加入。 ![Syntax highlighting][img-3] 主題設置至此已初步完成。 ## 其他設置 目前左側行數的區域還是白底黑字,跟旁邊已設定好深色主題的程式碼區域對比有些突兀,所以還要再做一些調整。 ### Environment 進到Settings→Environment→左側Colours,修改下列項目。 ![Colours][img-4] - Code completion : Tooltip/Calltip background:提示框背景顏色 (R60 G60 B60) - Code completion : Tooltip/Calltip foreground:提示框文字顏色 (R212 G212 B212) - Code completion : Tooltip/Calltip highlight:提示框高亮文字顏色 (R100 G210 B230) ![Tooltip/Calltip][img-5] - Editor : Highlight occurrence:和選取文字相同文字的標記顏色 (R255 G0 B127) ![Highlight occurrence][img-6] - Editor : Line numbers background colour:行數區域背景顏色 (R30 G30 B30) - Editor : Line numbers foreground colour:行數區域文字顏色 (R133 G133 B133) - Editor : Margin chrome colour:行數和程式碼中間區域的顏色 (R30 G30 B30) - Editor : Margin chrome highlight colour:行數和程式碼中間區域的顏色 (R30 G30 B30) ![Line numbers][img-7] ### Editor 進到Settings→Editor,修改下列項目。 ![Editor settings][img-8] - 左側General settings→右側Editor settings分頁,勾選Show indentation guides (在大括號之間畫一條線標示縮排區塊) ![Show indentation guides][img-9] ![Other editor settings][img-10] - 左側General settings→右側Other editor settings分頁,勾選Highlight line under caret (當前行顯示光棒) ![Highlight line under caret][img-11] ![Margins and caret][img-12] - 左側Margins and caret→右側Caret區(游標樣式設定),Width設為2,Colour (R212 G212 B212) ![Caret][img-13] [img-1]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp73HnpDg8eH6ZGKDNiNd7mDqSVPJ7bbasV7Vw9Lqtgp41Ob_LLmABZ-EFb0sXTVea447b1rexfBdD4eeKZDZjBQPtZoUVUQDZrZ8UNtnYffZ6k4jHO3Opp76xQ4Lw90xL6YWE1y-hmLkLxfb0yvCFMiW5WFHzFD8jqc4KDbAINPWziVcS8_Qs0dUafuzW/s1600/01_final.png [img-2]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1JivcChCfF_Dusy0uLowr2V8N__HDkqmw4yy9ONDy87ZRXW8YTEUzWlFCYHBAjO_XPX7hRlSiF4xHI0hAdncS5oiRtbBw1QYkF2fEROpRc724oPxBbTKdTRB3bMXqD4C6j3QFf9FgIYHz3SEdKL9zRNh5l_Raive8q8ybBuVL0UwOHwrlrZSY1nYf4ThA/s1600/02_cb-share-config.png [img-3]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAxFM8NTEMhP8sBXY4PZKPt0yelXKAaGfTg8JoCNSv9hDloriCfVYjhq2IJ9DcX-6oDwlcy0pRn7EqvpIu-WnUn_ltKyZnkq4uEKm_FweNhCy8kXUSoQ-5t9A0Yqat4jc_ccb5AFGRiDyUnT7LVqNw8DXMvt1hLQdOYGsTwjD1CetYoDavJJKMkxPOY7Ue/s1600/03_settings-syntax-highlighting.png [img-4]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihDtByqMS8nBvPyJCvj7VA18qXZMcDkWWc6PSazOm9iVc71-LIViCxzTcBo8ph68_acDfW3lT4a3O8VurqtsdyzD8TugO0Rtmy_C-vN2rjYJwvXoJQ_UF9fWl47cw0N-E_b3vBuEEnhB0ahw-yDw0ELRQBWdYCVrBe-s-nrri50Ouj3XHBO3T7kbVm2yBf/s1600/04_settings-colours.png [img-5]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirlvYUTYrOiYFEX5Gu-xpplN61ixkc0Iudo7uhC-x-rmRRC4yAMUI5Ru1FgKfFdlrhyD7_kMVREHjlWcaCbRET4xzLttjTj9y5RPLzwel_m5GmxEyyAClJX7yFU54MUU1E5N1tJcxdD2iic0QAUKUGULj1l2Yq22PrBDnZIUm3t-Y6oejxOeTOuuYWRlAl/s1600/05_tooltip-calltip.png [img-6]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_FDtB2qXe46XosF5Sp5ExsdZm3tVXh30Lds94gP2TJPzeIw7xfNUKIm6jziafVgWwDOChmNMZ8YMp2_bJBzkxfKKNOAbpLl4Uu0f6doGsesx_B0g7vzVk3p-1dAAr74PuzaZc8THDeEZnqB2nfxExDvnjKPzqTz49Tiq03FjA1bCwee743keR52nokEOJ/s1600/06_highlight-occurrence.png [img-7]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNaRADC0KC5jy_E6eA1EdFMAwjwcSkglp73vNv60De7br9XswDpoZET_kt_Ot_pvKJOs30aN-JYzGGEpKRBaKAA5mbMOoGe22ZMrvu3LBmykYJQUERG0zODzfTEgUAm_czR6zNKeHDhW9mh8uXyULrxHgonvHn6ceKqBSthzq8uLhyTJVJmDVuvFf6uNQB/s1600/07_line-numbers.png [img-8]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8MOIqd3MWo2ngdTuTiU8h1jjuMXCL2jt6-QWAxTSbdwU1lfgf6Tx9s7DfDIrwknW2LM8_lQ_0JMTfKUUmmPorLDcM4jiQfEuKQVJg5gSsfeQurs-8yu2sY-espevbIULxupBuJZSuW8ljLBSQKK4l_qDsJFIGPpfAmXgy9sYNqixzEmGSDYrbTW0JhNFY/s1600/08_settings-editor-settings.png [img-9]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTgHzcZ8U0KnwgseN3Zn7RgH5x0_qpSa64-nXDtft16g1uyCXYlWCf8q-o0qA4TdAftDT81zxmuPc4OT7qNP29LMRVcx5mB3G0BlwEUx9CcTZcXJ40vR50PWgNn43hu0ruSoSm_sSutLFt8RR6WkYjw5kNJhczjefQJLpIy_ZufpGm-4wSQytb29lyd4UW/s1600/09_show-indentation-guides.png [img-10]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0vpCk6-uG39-AM-uBF6GJbbHkYiBmzuJs9d21NIr8tO6Gz9ycQnNCifGZIKa6C3ULKBFlA2WgBGqYQ8HVUfs8orKuLaDl3G7KCJ4gbubTGr_FKF_t4sZ4hNU-xWbEqjre1bp_dfgNQ78LVEcdxS8K0GwmTLD2m0lNiqxWk014QUAgLTBo_zdoRGx2ejeW/s1600/10_settings-other-editor-settings.png [img-11]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGGaeHVJX_75ZGxZiSKlZM4vBZ_G4tQFYsiCop8E95HOAEHVBsusEXkzB2jjlYEcsfJhovd3TSfx9TWGTABd8I_bgt8Fsw6zGbx4KN1Ec4PM2xfcJvt3gMEiZFy6qNxVKKBbXTIHVr8zcu2Mv39IgLxJbC7JncSsymZAVPCJzhKZFjHm7UNNSzHxxpjcKv/s1600/11_highlight-line-under-caret.png [img-12]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz5zMDeK_swNQ8P4R_POrOSjHCG3Nf-y3z700DD474Rok9zygK3MoYl9-cmwi2MOoq6_Jhiq_p9k9jmoFUXdjpZaH5xA3-FpUL4IhH40hdCHWklyz9EkzF-g8RoWSKuBmdcJGeJyXi-R_pD0v7vE4aIoilKNfgegu8pGhTo6EsTg4YMvaqOd_Tsd_OiQHC/s1600/12_settings-margins-and-caret.png [img-13]: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbntseVxejYqVt-ITY0W06IkbdY-5BTcWpNvNLV3w6TTPA2emJokRU2WHeADbu4b-YOOW1aDgksFbGtElJBbtDP_q3lT0Z4Gd5ulnMWez8xXNPrg9OgSVg6N0eqTEJIC9iU0_-M32mbo5uB43yWKI8dXpmtMY6LzNd1pOSV470-gyYeKD7Vg-Gi-ojA2HH/s1600/13_caret.png
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up