Auto indent after pressing Enter


#1

Hello !

I just switched to Atom and so far it’s really perfect except one little thing.

My CSS/LESS/SASS habitually looks like that:

.class {
width:2020px;
position:relative;
}

Without extra TAB before the properties.

But, Atom keeps adding a TAB when i write brackets { } and press enter.
I tried deactivate auto-indent but no, i obviously need this.
I just want my cursor to stay on the closing bracket level. Can i find an option to do that ?

Thank you very much.


#2

Did you uncheck the Auto Indent setting on the language-css package?


#3

If i do that, i will lose the auto indentation completely.
If i am writting a sub-selector in less/sass (so, several tab away from the left of my window) i don’t want my next “enter” to bring back my cursor completely to the left. I want to stay at the same level.


#4

In that case, you can disable the indentation changes with the following in your config.cson:

".css.source":
  editor:
    increaseIndentPattern: ""
    decreaseIndentPattern: ""

#5

Thank you, that works perfectly !

Can i ask you, what is the logical way to find options like that when needed ?

I searched a lot before asking here but found nothing. I didn’t even know where to start to find this in the config files.
The Key Binding Resolver didn’t seems to help here neither, am i wrong ?


#6

The settings were probably intended mostly for the use of language package designers. You can see it in the settings/ of many language packages, like language-javascript.