Changing the behavior of auto-indent


#1

The above (picture) happens when I do Edit > Lines > Auto Indent
I feel like indenting the immediate children of the body tag is a waste of space.
Is there an option to not indent them when using auto indent?

atom


#2

This is controlled by the settings of the language package. You can override any language settings through your config.cson file (File -> Config...). Just add the following (assuming you don’t have a ".text.html" already, which you probably don’t):

".text.html":
  editor:
    increaseIndentPattern: '''(?x)
      <(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|link|meta|param|body)\\b|[^>]*/>)
      ([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*</\\1>)
      |<!--(?!.*-->)
      |<\\?php.+?\\b(if|else(?:if)?|for(?:each)?|while)\\b.*:(?!.*end\\2)
      |\\{[^}"\']*$
    '''

#3

Thank you!