How do you deal with conflicting bindings?


#1

I recently installed atom-runner, but it uses cmd-r as it’s main keybinding. This conflicts with the default cmd-r keybinding which searches for symbols.

I’ve tried configuring my keymap.cson, but no dice.

# keymap.cson

'editor':
  'cmd-r': 'symbols-view:toggle-file-symbols'

'editor':
  'ctrl-r': 'runner:run'

Any suggestions?


#2

Your scope is just missing a period. editor should be .editor :wink:


#3

Woops! Good catch, but it still doesn’t work :\


#4

Darn! I’m not sure then… Maybe try looking in the Keybinding Resolver (Command+.) and see if something else is taking precedence?


#5

I installed atom-runner today and ran into the same problem. The package’s keymap scope is so specific that it’s overriding our shallow .editor rules.

I added this to my keymap.cson to get it to work properly.

'.platform-darwin .workspace .editor':
  'cmd-r': 'symbols-view:toggle-file-symbols'
  'ctrl-r': 'runner:run'

#6

Ah that makes sense, thanks!


#7

I frequently have similar situations, where I want to override or completely disabled a shortcut for a feature that I don’t use from a particular Package.
To completely disable a shortcut for now I resort to editing the original package keybindings. This off course isn’t ideal because any package update will break those changes.

How do you deal with this?


#8

In the Keymaps documentation, under “Removing Bindings”:

If you want to remove a binding from a keymap you don’t control, such as keymaps in Atom core or in packages, use the unset! directive.


#9

@leedohm is overwriting package key binding still only option(except overwriting package keybiding directly) how to resolve conflicts?


#10

Yes, it is currently the only option. Do you have a suggestion for another system?


#11

I wrote a couple of suggestions here