How to list command identifiers (not descriptions) for keybind?


#1

Hi guys ,

I find it bit hard to add key binding for command. My understanding is that each command has description and identifier. Description shows up in Command Palette and identifier is used for key binding among the other.

Is my understanding correct? If yes how can I easily find command identifiers or how can I easily add key binding for command without knowing its identifier?


#2

Converting from the command palette name to the command name is really simple, let’s say we have an entry in the Command Palette of Foo Bar: Baz Quux. The command name would be foo-bar:baz-quux. The rules are:

  1. Convert everything to lowercase
  2. Remove the space after the colon
  3. Convert all other spaces to hyphens

There is also the Keybinding tab in the Settings View. You can easily get the keymap syntax to override a keybinding by clicking the copy button next to an existing keybinding:


#3

Hi Lee,

IMHO seems like this functionality could be improved. It could get more tricky when author of some package won’t use all lower case in command names. I have tried it my self and by changing one letter to upper case keybinding stopped to worked. Secondly I think this could be more user friendly, what do you think?

User could add new key shortcut through Keybindings screen. ideally you don’t have to write ctrl , shift, alt etc by hand , letter by letter but rather just push the right button.


#4

You could say that about any convention, really. If a package author doesn’t follow the standard conventions … then typically they’re only making things harder on themselves.

As for your suggestion, it has already been suggested on the settings-view package here:


#5

Great thanks for the informations :smile:


#6

Also I believe you can open a console and inspect atom.commands.registeredCommands to see the identifiers for all registered commands.