Overriding keybinding not working


#1

I want to override the keybinding for Alt-F3 which is ‘find-and-replace:select-all’. I want to replace the key combination with Ctrl-alt-G, so I opened my user keymap.cson file and entered:

‘atom-text-editor’:
‘Ctrl-alt-G’: ‘find-and-replace:select-all’

but it doesn’t work although the old keybinding still does.
How do I make this work?


#2

Before you post code, you have to format it as code by highlighting it and pressing the </> button above the editor. Alternatively, you can post a screenshot or a link to a copy of the actual file. These other strategies can be more useful when it comes to debugging Atom’s CSON files, since the mistakes that a novice user is likely to make are hard for novice users to identify. It’s frequently easier to provide experts (myself and a few others here) with a complete snapshot of all files concerned. In this particular case, the fastest solution would be to copy your entire keymap file and post it on Hastebin.

When you’re testing keybindings, you can use the Keybinding Resolver (ctrl-.) to see the full list of commands that get matched for each individual combination. Does ctrl-alt-g bring up anything?


#3

Thanks for your response and apologies for not posting the code correctly. Here it is again:
‘atom-text-editor’:
‘Ctrl-alt-G’: ‘find-and-replace:select-all’
Actually this element is the entire contents of the keymap file. I tried using the Keymap Resolver but when I then pressed ctrl-alt-g all that happened was a message at the bottom of the window ‘Key Binding Resolver: ctrl-alt-g’ and nothing else so I’m none the wiser. Alt-F3 still works.


#4

That’s still not formatted right.

Marking it as code is important, because it retains white space and doesn’t turn quote characters into the curved types.


#5

I believe it is case sensitive, so G is not the same as g, in case that’s what you mean. For example, ctrl-G means ctrl-shift-g, not ctrl-g.


#6

Thank you so much for that. You are dead right! I changed the code to
ctrl-alt-g
and it worked immediately. I note that the small c for ctrl is also important. What a shame they don’t make that clear in the extensive keymap comments.