Author Topic: How do I export CodeBlock themes and layout?  (Read 10431 times)

Offline ulfben

  • Single posting newcomer
  • *
  • Posts: 3
How do I export CodeBlock themes and layout?
« on: October 31, 2008, 03:07:30 pm »
Hi everybody! I'm a long time Visual Studio-slave, trying out some cross platform work. To make myself feel like I home, I spent some time configuring CB syntax highlights (Zenburn), keyboard shortcuts (to mirror Visual Studio) and cleaning up the GUI-layout.



I would like to use this exact same setup on my Linux and Mac installs, and share the config with others. But I can't find a way to export my settings.

How can I export my settings for others to use? (and what do they do to import them?)

For now: if anyone wants the zenburn theme and some VisualStudio-keybinds, my configs are available here (7zip). I didn't replace CB-default binds, only added a few VS ones. Feel free to add / improve on it and post updates here!

I'm using Microsoft's beautiful Consolas ClearType-font. Here's a way to get Consolas free of charge.
« Last Edit: November 01, 2008, 04:19:57 pm by ulfben »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2775
Re: How do I export CodeBlock themes and layout?
« Reply #1 on: November 01, 2008, 01:40:33 pm »
Search for "portable" in this forum and on the wiki.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_make_Code::Blocks_portable.3F
FAQ - CodeBlocks

The key definitions are in cbKeybinder.ini in the same directory as the default.conf. Copy your .ini files along with the .conf

Since the key definitions are bound to the menu id's, the linux and mac id's may be different, causing temporary errors when CB is first started on those systems. KeyBinder will eventually see the errors and compensate internally during scan intervals of 15 seconds.

I finally stopped moving my conf files between system types because wxWidgets uses dynamic id assignment for keys, windows, controls, etc. This causes programatic confusion when recording those id's and moving them from one system to another.
« Last Edit: November 01, 2008, 01:52:58 pm by Pecan »

Offline ulfben

  • Single posting newcomer
  • *
  • Posts: 3
Re: How do I export CodeBlock themes and layout?
« Reply #2 on: November 01, 2008, 04:16:08 pm »
I was afraid manually copying the configuration files was the only way...

What I'd like to see is a clean way to export / import settings. Exporting should produce a single file, compatible with any CodeBlocks-install.

The user should be able to select categories of settings to export/import:
  • Syntax highlight:
    Color themes for the editor, obviously. :)
  • Theme / styles:
    Fonts, GUI-colours, GUI-layout, GUI-settings. (auto hiding panes, auto scrolling output, etc)
  • Environment:
    compiler settings, paths and such. ("private" settings, but useful for backup/restore)
  • Plugins:
    plugins should be able to add their settings to the export/import-feature.

What's the proper way to do feature request like these?
« Last Edit: November 01, 2008, 04:24:31 pm by ulfben »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How do I export CodeBlock themes and layout?
« Reply #3 on: November 01, 2008, 04:43:00 pm »
What's the proper way to do feature request like these?
Did you try cb_share_config already? It's in SVN and probably in the nightlies, too (I didn't check).
BTW: Usually all plugins have their settings in the C::B config file. There are only a few which make an exception (for good reasons). But these are maybe 1-2 more files to just copy.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ulfben

  • Single posting newcomer
  • *
  • Posts: 3
Re: How do I export CodeBlock themes and layout?
« Reply #4 on: November 01, 2008, 05:48:35 pm »
[...]I finally stopped moving my conf files between system types because wxWidgets uses dynamic id assignment for keys, windows, controls, etc. This causes programatic confusion when recording those id's and moving them from one system to another.
That's bad news! Couldn't/shouldn't we have an abstraction layer between wxWidgets' and Code::Blocks' settings?

@MortenMacFly:
No, I haven't heard of cb_share_config. Searched the forums for info on cb_share_config just now but don't get much more info than this. Where can I get it and what exactly does it do? Is it available for all platforms?

I just ran with the binary download for each platform (which is what my students will do anyway) and can't find nightlies anywhere...

About plugin's settings:
I just meant that in the system I envisioned, it's important that a user can control what sub-set of settings to import and export. And that plugins should (when possible/suitable) be covered and have their own category. It doesn't make sense to send all my settings just to hook a friend up with a sweet theme. :)
« Last Edit: November 01, 2008, 05:59:33 pm by ulfben »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How do I export CodeBlock themes and layout?
« Reply #5 on: November 01, 2008, 06:03:29 pm »
No, I haven't heard of cb_share_config. I just ran with the binary download for each platform (which is what my students will do anyway) and can't find nightlies anywhere...

Searched the forums for info on cb_share_config just now but don't get much more info than this. Where can I get it and what exactly does it do? Is it available for all platforms?

If you have installed the 8.02 binaries from download-section, you should have it, or you are able to install it.
On windows you have to chose it on the installer page, where you chose the type of installation (just check "C::B share config", it's not checked by default).
You may have to reinstall C::B to do so, but this should not change your "default.conf" (nevertheless it's always safe to backup the config of course).

The executable is in the same directory, as the codeblocks binary.

On debian it's part of the main ("codeblocks") package and will be installed to "/usr/bin".
I don't know inside which package it is on other distros (or on Mac), but it should be there.