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?

4

2 回答 2

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.

于 2015-10-08T02:44:26.017 回答
0

Atom version used: 1.15.0

  • go to settings: ⌘</kbd>,
  • 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 ⌘</kbd>+shift+p and enter keymap. Click on Application: Open your keymap

  • go to bottom of the file. Paste the keybinding ⌘</kbd>+s

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

于 2017-03-29T12:24:43.177 回答