Nowadays, developers often work in several different development environments and text editors. For example, you may need Eclipse for regular Java development, Android Studio for Android development, Xcode for iOS development, Visual Studio for C#, Sublime Text for web development, etc.. Every tool, however, has different keyboard shortcuts. Since it is hard to remember all shortcuts, there's a constant loss of productivity when switching tools. If you don't want to edit all shortcut sets in every tool, you can instead use CodingKeys as an "abstraction layer".
CodingKeys lets you define unified shortcuts, which are dynamically re-mapped to existing shortcuts of other applications when you switch tools. All mappings can be conveniently edited in a single configuration file. The config file also gives you a nice overview over all shortcuts and grows as you add new apps to your coding toolbox.
CodingKeys dynamically registers keyboard shortcuts when one of the defined applications is activated (and unregisters the shortcuts when the application is deactivated). It then generates keyboard events based on the mappings defined in a configuration file and sends those events to the active application.
CodingKeys runs on OSX (tested on OSX 10.8). Download the latest release.
Unzip the file and copy the .app file into your program folder. When you start the app, an icon should appear in the status bar.
Important Note: Please make a backup of your key file before you install an updated version. (The mapping file is currently contained in the application package.)
CodingKeys runs in the status bar (small keyboard icon with a "C" symbol) and currently has four menu
Launch At Startup,
Quit. All options except
(see separate section) should be self-explanatory.
Key Mappings from the menu opens the configuration JSON file in your default text editor.
Each mapping has the following fields:
- command: The name of the command
- key: The shortcut for the command
- mapping: Each application and its corresponding shortcut
This name is just for your own information.
The unified shortcut, consisting of unicode symbols, separated by spaces.
You can add modifiers such as
⇧ (Shift) and special keys,
↑ (Arrow Up) or
↓ (Arrow Down). The full list of available options is shown at the end of this
file. See the exisiting key file for some examples and combinations.
The mapping part lists each application you want to support and the corresponding shortcuts. Use the name displayed in the title bar of the application. This name is used to find the active application and the mappings that should be registered.
You can map a shortcut to a sequence of multiple keys. For example, in Xcode there is no default shortcut
to duplicate a line. However, pressing a sequence of five different key combinations in succession
achieves the same effect. Each part of a sequence must be separated by a
| (pipe). The sequence for the
duplicate line command in Xcode is:
⌃ A | ⇧ ↓ | ⌘ C | ⌘ V | ⌘ V
When CodingKeys sees pipes, it fires those key combinations one after the other. That way, you might also want to add other shortcuts that trigger useful sequences (although I haven't found use cases beyond Xcode yet...).
Whenever you save the file, the mappings are automatically reloaded and should immediately take effect. Please make sure to use correct JSON syntax. The app currently handles errors poorly, so chances are the app won't start or crash if there are errors in this file. If something goes wrong, make sure to copy your mappings and then re-install the app.
The default key file contains mappings for some commands of Eclipse, Android Studio, Xcode and Sublime Text. You might need to change some of the mappings for Xcode (Move Line Up, Move Line Down) or add non-existing shortcuts (for example, renaming has no default shortcut in Xcode).
|Command||Key||Android Studio||Eclipse||Sublime Text||Xcode|
|Move Line Up||
||⇧ ⌥ ↑||⌥ ↑||⌃ ⌘ ↑||⌃ ⌥ ↑|
|Move Line Down||
||⇧ ⌥ ↓||⌥ ↓||⌃ ⌘ ↓||⌃ ⌥ ↓|
||⌘ D||⌥ ⌘ ↓||⇧ ⌘ D||⌃ A | ⇧ ↓ | ⌘ C | ⌘ V | ⌘ V|
||⌘ ⌫||⌘ D||⌃ ⇧ K||⌃ A | ⌃ K | ⌃ K|
||⌥ ⌘ L||⇧ ⌘ F||⌃ ⇧ R||⌃ I|
||⇧ F6||⌥ ⌘ R||⌃ ⌘ G||⌃ ⌥ R|
||⌘ /||⌘ 7||⌘ /||⌘ /|
||⌘ O||⇧ ⌘ T||⌘ P||⇧ ⌘ O|
||⌃ R||⇧ ⌘ F11||⌘ B||⌘ R|
If you add new commands or tools and want to share them, just open an issue (tag
key file) and paste your
Working with key codes is somewhat tricky and non-trivial, so you might discover some combinations or special keys that don't work. Please open an issue and describe the problem or just fix the issue yourself :) and send a pull request.