CLion includes several predefined keymaps and lets you customize frequently used shortcuts.
A keymap is a list of actions with corresponding keyboard and mouse shortcuts and abbreviations.
You can find keymap configuration in:
You cannot save changes in predefined keymaps. Instead, when you modify any shortcut of a predefined keymap, CLion creates a copy of that keymap, which you can then configure as needed.
Click to duplicate the selected keymap, rename, remove, or restore it to default values.
CLion automatically suggests a predefined keymap based on your environment. Make sure that it matches the OS you are using or select the one that matches shortcuts from another IDE or editor you are used to (for example, Eclipse or NetBeans).
Some actions inherit their keyboard shortcuts or mouse shortcuts from other actions. On the Keymap page, you can navigate to the parent action using the inherited from link. When you change a shortcut of a parent action, all shortcuts of its child actions change accordingly. When you change a shortcut of a child action, it does not affect the shortcuts of its parent action, but the inheritance link is removed making both actions independent.
To find an action by name, type it in the search field of the Keymap page. If you know the shortcut of an action, click and press the key combination in the Find Shortcut dialog.
When consulting this page and other pages in CLion documentation, you can see keyboard shortcuts for the keymap that you use in the IDE — choose it using the selector at the top of a page.
Add a keyboard shortcut
On the Keymap page of the Settings dialog Ctrl+Alt+S, right-click an action and select Add Keyboard Shortcut.
In the Keyboard Shortcut dialog, press the necessary key combination.
If necessary, select the Second stroke checkbox to define a complex shortcut with two sequential key combinations.
Click OK to save the shortcut.
The key combination that you press is displayed in the Keyboard Shortcut dialog, as well as a warning if it conflicts with existing shortcuts.
Add a mouse shortcut
On the Keymap page of the Settings dialog Ctrl+Alt+S, right-click an action and select Add Mouse Shortcut.
In the Mouse Shortcut dialog, move the mouse pointer to the central area and click or scroll as necessary.
Click OK to save the shortcut.
The performed mouse manipulations are displayed in the Mouse Shortcut dialog, as well as a warning if it conflicts with existing shortcuts.
Add an abbreviation
An abbreviation can be used to quickly find an action without a shortcut. For example, you can press Ctrl+Shift+A and type the name of the Jump to Colors and Fonts action to quickly modify the color and font settings of the element under the current caret position. If you assign an abbreviation for this action (like JCF), you can then type it instead of the full action name.
On the Keymap page of the Settings dialog Ctrl+Alt+S, right-click an action and select Add Abbreviation.
In the Abbreviation dialog, type the desired abbreviation and click OK.
Reset action shortcuts to default
If you changed, added, or removed a shortcut for an action, you can reset it to the initial configuration.
On the Keymap page of the Settings dialog Ctrl+Alt+S, right-click an action and select Reset Shortcuts.
Location of user-defined keymaps
When you modify one of the default keymaps, CLion creates a custom keymap file in the keymaps directory under the CLion IDE configuration directory:
A custom keymap file contains only the differences relative to its parent keymap. For example, if you modify the default Windows keymap, your custom keymap will be its child. The file will contain only the shortcuts that you added or modified, while all other shortcuts of your custom keymap will be the same as the default Windows keymap.
You can share your custom keymaps with team members or between your IDE instances. Copy the corresponding keymap file and put it in the keymaps directory on another CLion installation. Then select the copied keymap on the Keymap settings page.
Conflicts with global OS shortcuts
Predefined keymaps do not cover every possible platform, version, and configuration. Some shortcuts can conflict with global system actions and shortcuts for third-party software. To fix these conflicts, you can reassign or disable the conflicting shortcut.
CLion detects conflicts with system shortcuts and notifies you with a popup message:
Click Modify shortcuts to open the Keymap settings dialog where you can make the necessary adjustments:
Here are a few examples of possible system shortcut conflicts with the default keymap in CLion. Make sure that function keys are enabled on your system.
Select the previous input source
Basic code completion
Search man Page Index in Terminal
Open the Settings dialog
Open the tty12 virtual console
Switch between Workspaces
Undo/redo navigation operations