Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change or add dark theme to CodeBlocks?

I have just installed Codeblocks in my Windows. When I launch the application the background of the screen where we write the code is white. I would prefer black or any other color. I am not sure whether we can change the color/theme OR add more themes.

like image 504
Saurabh Dhage Avatar asked Nov 02 '25 11:11

Saurabh Dhage


2 Answers

First, you need to download some syntax color schemes, so I recommend you to download this file: colour_themes.conf. Then you will have to install it. Follow these steps:

  • Close the program Code::Blocks.
  • Run the program cb_sharing_config.exe (for Windows users, so it's your case). For Linux or Mac users, run the command cb_share_config from the terminal.
  • This program UI has 2 columns. In the left column, you have to load the downloaded file: colour_themes.conf. In the right column, you have to indicate the file default.conf (it will find the path automatically).
  • Select the themes you want to import to Code::Blocks. Then, click Transfer to transfer them to the file default.conf. Finally click Save. You probably want to select them all to use them later.

Now, the color schemes are installed, so it's time to select a new one:

  • Open the program Code::Blocks.
  • Go to the menu: Settings > Editor and select the tab Syntax highlighting.
  • You will see a select box with the label colour theme; select one.

Finally, if you have chosen a darker theme, you might have trouble seeing your text cursor or caret, with its colour being a separate setting:

  • Go to the menu: Settings > Editor and select the tab Margins and caret.
  • In the Caret section, change the Colour from the default black to a more contrasting colour for your theme, like white or yellow in case of a dark theme.
like image 144
Unix Avatar answered Nov 04 '25 04:11

Unix


Go to this site https://gist.github.com/yzhong52/6852140faa233408de67.
Download the file as zip, extract and copy out the colour_themes.config file.
Close CodeBlocks.
Open CodeBlocks Share Config on the machine.
Click Source configuration file ... and select the downloaded colour_themes.config file.
Click Destination configuration file ... > Local Disk > Users > Your PC Name > AppData > Roaming > CodeBlocks > Choose default.conf.
Meanwhile set your file explorer to show hidden items so as to show AppData folder.
Mark/check all the boxes showing under the Source configuration file.
Then click Transfer >>.
Click Save.
Open CodeBlock, go to Settings > Editor... > Syntax highlighting.
Select default > click OK.
Now open your code.
You will notice you can't see your cursor, let's fix that.
Settings > Editor... > Margins and caret.
Click Colour, change it to white, click OK.

Enjoy :)

like image 33
Samuel Francis Avatar answered Nov 04 '25 06:11

Samuel Francis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!