Today, Qt 5.3.1 was released along with Qt Creator 3.1.2. Unfortunately, nsf’s EmacsKeys plugin, merged into the Qt trunk a few months ago, was not a part of this release (it should be included in Qt Creator 3.2).
Because the Emacs keybindings are hardwired into my fingers, and I’m using QtCreator for a project at the moment, I spent some time figuring out how to get the plugin built for Qt Creator 3.1.2. This post explains how you too can build it, but, if you’re on Ubuntu 14.04 with Qt 5.3.1 x64, you can just download my binaries and the keymap file (see under requirements).
I’ve tried to setup most of the common Emacs keybindings documented in nsf’s plugin, plus a few more, and I’ve gotten rid of the conflicts. (Thanks nsf for putting me on the right path with that!)
You need to have Qt 5.3.1 installed. I used the open source x64
.run files made available by the qt-project.
For both of the following approaches, download and unpack the qtcreator-emacskeys archive I’ve prepared especially for you.
- Copy the archive
- Copy the archive
- Start QtCreator.
Help | About | Pluginsactivate
- Restart QtCreator.
Tools | Options | Environment | Keyboardclick on
Importand then select
You can scroll down to the Emacs Keys section and check that my choices work for you.
Get the Qt Creator source code by typing:
git clone --recursive https://git.gitorious.org/qt-creator/qt-creator.git
src/plugins/emacskeys directory somewhere else, out of the whole
qt-creator tree, because you’re going to revert to the 3.1.2 release version:
cd qt-creator git checkout tags/v3.1.2
emacskeys.pro from my archive into the
emacskeys directory that you copied out. Edit
QTCREATOR_SOURCES to point to te v3.1.2 qt-creator checkout that you prepared above, and
IDE_BUILD_TREE to point to your installed QtCreator directory.
In QtCreator, open the .pro file that you’ve just edited, and build the project. If all goes according to plan, this will put the resultant .so file into the correct plugins directory in a subdirectory called
Now follow the rest of the steps from the easy way above.