Getting command name from command palette?


#1

Forgive the noob question but how do I get the command name from the command palette so I can add another binding for it to the keymap?
Currently I’m using the keybinding resolver but this only works for commands that already have keybindings.


#2

You can open the console (View > Developer > Toggle Developer Tools) and paste the following command to get all registered commands:

atom.commands.registeredCommands

Usually the format is the slug of the package name, followed by a colon and the slug of the command name. For example, the command for Settings View: Show Keybindings is settings-view:show-keybindings.


#3

When translating from the Command Palette to a keybinding, everything is lower case with dashes instead of spaces.


#4

Just for the record: command names can contain uppercase letters. It’s probably not so common, but it can be used for better readability of acronyms (e.g. Json vs JSON). I always wished that Atom would solve this better.


#5

Good to know.