Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve keybinding-conflicts in atom.io

I installed the atom.io plugins git-plus and asciidoc-preview.

Unfortunately both claim the keybinding Ctrl + Shift + A. There is no warning shown in the keybinding-settings.

atom.io settings for key-bindings

How to solve this Problem? Should I manually add the *.cson files and add another keybinding? Or is there a way to do it directly in atim.io?

like image 808
Edward Avatar asked Oct 07 '15 09:10

Edward


People also ask

How do you change the Keybinding of an atom?

You have to go to Edit -> Preferences -> Keybinding. In this tab you can see your actual binding and if you want to change it, you can access to the keymap file and overcharged configuration. To access this file you can click on the link below the "Keybindings" title.

How do I remove key binding resolver in atom?

Press esc button or ctrl + . again. It will remove the popup.

How do I open keymap in atom?

Call command palette ctrl-shift-p , type "keymap" and select "Application: Open Your Keymap" or open file manually: ~/. atom/keymap.


1 Answers

You can override the key binding and manually set it to the command you want to run:

  1. Open the Key Binding Resolver (Ctrl + Shift + P, type Resolver).
  2. Press your key binding in question (Ctrl + Shift + A).
  3. The Resolver will show all the commands and the selectors associated with that key binding. The one that took precedence is highlighted, and the ones that are ignored are not highlighted. Make a note of the highlighted command in the first column or the selector in the second column (looks like a CSS selector).

enter image description here

  1. Go to the Settings > Key bindings screen.
  2. Search for the command or selector and click the clipboard button in the leftmost column of its row. This puts it into your clipboard.
  3. Open your keymap.cson (Ctrl + Shift + P, type Open keymap).
  4. Paste the selector.
  5. Override the command associated with that selector. Using the most specific selector from your screenshot as an example, this will make the Ctrl + Shift + A key binding run the git-plus:add command:

'.platform-win32 atom-workspace, .platform-win32 atom-workspace atom-text-editor, .platform-linux atom-workspace, .platform-linux atom-workspace atom-text-editor': 'ctrl-shift-A': 'git-plus:add'

Alternatively, you can use a package such as disable-keybindings or keymap-disabler to disable key bindings on a per package basis: https://discuss.atom.io/t/disable-default-keybindings/1077/36.

Updates:

As of Atom version 1.1: The feature for disabling keybindings per package is now core.

As of Atom version 1.12: User key bindings now take precedence over package key bindings regardless of their selector specificity.

like image 101
user2943490 Avatar answered Sep 20 '22 03:09

user2943490