How to execute command without entering palette?


So i have added a command to my init.cofee

atom.commands.add 'atom-workspace', 'custom:colonize', ->
  editor = atom.workspace.getActiveTextEditor()

And added to keymap.cson

  'shift-enter': 'custom:colonize'

but i will like to execute it without having to enter the command palette.


You don’t have to enter the command palette to execute the command if you’ve mapped the key binding correctly. Have you tried using the Keybinding Resolver (Cmd+. on OS X and Ctrl+. on other platforms)? It will show you what key Atom saw you press and the command that was triggered because of it.


Yes, it executes first


and my command is the second on the list but does not executes.


Here’s what I see when I press Shift+Enter:

Notice the selector on the editor:newline command? It is much more specific than the atom-text-editor selector you show in your example. Atom keybindings use CSS selectors and are therefore governed by specificity rules. See the Flight Manual for more details: