Keymap hell


#1

I’m trying to stop atom from using ‘tab’ for snippets:next-tab-stop and snippets:expand both of which it uses inside
’atom-text-editor:not([mini])’:
context. I’ve ‘unset!’ it which rendered tab completely useless and I’m trying to reset it to the other prior functions it used to do before. And I’m struggling to find how to map ‘tab’ to several commands within the same context like it is by default for several contexts and I’m struggling to setup a key to replace ‘tab’ within the
’atom-text-editor:not([mini])’:
context for those both snippets:next-tab-stop and snippets:expand commands. I can only set it to a single command.


#2

What’s your end goal here?


#3

Keep ‘tab’ for what it was except snippets:next-tab-stop and snippets:expand and map ‘`’ to those.


#4

Go to the Packages pane, search for the snippets package, and click on the box. There’s a section titled “Keybindings”, and a checkbox that lets you turn off the bindings from that package, specifically. You can then manually set new bindings for the commands.


#5

Thanks! That covers the ‘tab’ problem.
What about binding a key to 2 actions?


#6

So it seems that the Snippets package gets around the problem somehow by having multiple files, but you can just define a selector that has a different literal meaning but amounts to the same thing, like

'atom-text-editor':
  '`': 'snippets:expand'
'atom-text-editor:not([mini])':
  '`': 'snippets:next-tab-stop'

#7

Yeah, I knew about such a method, though I hoped it could be done otherwise… Hope Atom team will implement that feature which is like… extremely simple?.. Could have easily been
’`’: [ ‘snippets:next-tab-stop’, ‘snippets:expand’]

Thanks for your insights!