How to resolve keybinding-conflicts in atom.io
Asked Answered
E

2

18

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?

Empathic answered 7/10, 2015 at 9:10 Comment(0)
H
21

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.

Hemicycle answered 8/10, 2015 at 2:44 Comment(1)
This needs getting used to. Now I understood, that each definition of a key-binding consists of the scope (e.g. "editor window") the keystroke and the command. ThanksEmpathic
L
0

Atom version used: 1.15.0

  • go to settings: ,
  • go to Keybindings tab
  • type your command, it'll show all the keybindings associated with your comand
  • save the keybinding by clicking on the copy button. It'll save it to your clipboard. a copy cutton

  • type +shift+p and enter keymap. Click on Application: Open your keymap

  • go to bottom of the file. Paste the keybinding +s

Done! You should now be able to use your command which atom sorts with higher preference.

Loaiasis answered 29/3, 2017 at 12:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.