Code indentation: missing shortcut


I have a question regarding indentation in Atom (0.123.0):

Lets assume this is the code in qusestion:

function test() {

  1. Atom has a built-in option in Edit > Lines > Auto Indent
    If I will select the text and run it through the above, it will work
    However, this command does not have a keyboard shortcut.
  • Can I give it shortcut key?
  • Can I make it work by not select the code lines beforehand?
  1. There is the package Auto Indent
    With this package I do not need to select the code lines beforehand. I can simply invoke the command line and select the package command
  • This package has a shortcut shift-cmd-l, but it does not work


Have you taken a look at the Keymaps document? You can find other documentation on the Atom website here:


Does not seem to work…

For the Auto Indent package, the Keybindings settings page shows the following.
This shorcut does not work for me regardless:

shift-cmd-I auto-indent:apply Auto Indent .editor

So anyway, I open the keymap.cson file and put the following just for the sake of testing:
'.editor': 'cmd+p': 'auto-indent:apply'

Still does not work.

So now I wanted to add a shortcut for the Edit > Lines > Auto Indent core functionality (which does not have a shortcut by default), but I can’t find it in the list…

And given the experience above, I think it won’t work anyway?


The Editor Auto-indent works for me from the command pallette:

But I don’t know if it depends on the file type/grammar?


Yes, it works from the command palette, but I am looking for a shortcut to either work it, or change the short cut of the Auto Indent package (which has a shortcut, but does not work, even if customizing it).


I don’t know if there is indeed a bug or not with binding keyboard shortcuts, but I found myself moving to a different package altogether - atom beautify.

Thanks anyway…


I don’t know about the auto-indent package, I haven’t used it.

There isn’t a bug with the keyboard shortcuts to my knowledge … other than the AltGr bug, which doesn’t seem to apply to you. You are correct, the following will not work:

'cmd+p': 'auto-indent:apply'

I’m not sure if you looked at the document I linked or not, but the correct format and command would be:

  'cmd-p': 'editor:auto-indent'

The indentation is significant and it must be a hyphen in the keybinding, not a plus.


You’re right. I’m not sure why I put a + there, that’s silly.