Overriding core keybindings : selector not recognized


#1

I want for example, to use 'ctrl-l' to move right
So I open the keybindings resolver, use the right arrow, and see that the command is 'core:move-right' and set for the 'body' selector. I try to put it in my keymap.cson file:

'body':
  'ctrl-l': 'core:move-right'

Save the file, try 'ctrl-l', the keybinding resolver tells me that 'editor:select-line' has the precedence because is defined in the default keymap with the selector 'atom-workspace atom-text-editor'. I change my keymap.cson file to:

'atom-workspace atom-text-editor':
  'ctrl-l': 'core:move-right'

Save the file, try 'ctrl-l', the keybinding resolver tells me that ‘editor:select-line’ has the precedence because is defined in the default keymap with the selector 'atom-workspace atom-text-editor', while my own keybinding is only defined under selector 'atom-text-editor'.

Why does it recognize only half of the selector of my keybinding?


#2

I don’t know, but it should. I can use 'atom-workspace atom-text-editor' just fine. You’re trying the right thing. Have you reloaded Atom?


#3

My change got recognized today when I restarted the editor. It it confusing because for some other changes in the keybindings, the changes get activated just by saving the keymap.cson file. You can see the results right away. But for other kind of changes, especially the ones dealing with overriding core keybindings with . The conclusion of this is that to be sure, always restart Atom after changing a keybinding. Do you think I should fill a bug report for this?


#4

It works right away for me. So try it again, and see if you can switch it on and off by just saving keymap.cson.