Starting a new line without auto-indent


Is there a keyboard combination to start a new line at the beginning of the line without disabling auto indent?

For trouble shooting, I usually put temporary code and comments at the beginning of the line, rather than indented with the rest of the code. This makes it easier to clean up afterwards.

Most of the coding editors I use have something like shift-enter for this, but I can’t find a reference to this anywhere. Maybe it’s there but I just don’t know that it’s called.


Hmmm, I don’t believe so? There are a couple of commands that seem like they would do what you want if put together though - Editor: Newline Below and Editor: Move to Beginning of Line?

I put this in my init script:

atom.commands.add 'atom-text-editor', 'user:shift-enter-no-indent', ->
  return unless editor = atom.workspace.getActiveTextEditor()

And in my keymaps file:

'atom-workspace atom-text-editor:not([mini])':
  'shift-enter': 'user:shift-enter-no-indent'

So now with shift-enter, seems to do what you want?


Brilliant! I didn’t know you could do that. Thanks