How to change indentation mode in Atom?

I haven't been able to figure this out yet. Atom seems to use spaces as the default indentation mode. I prefer to have tabs instead though. Sublime Text has built in functionality for switching and converting indentation.

Anyone found out how to change the indentation mode of Atom?

Some screenshots from Sublime Text:

Sublime Text indentation menu openSublime text indentation menu


Solution 1:

See Soft Tabs and Tab Length under Settings > Editor Settings.

To toggle indentation modes quickly you can use Ctrl-Shift-P and search for Editor: Toggle Soft Tabs.

Solution 2:

Go to File -> Settings

There are 3 different options here.

  1. Soft Tabs
  2. Tab Length
  3. Tab Type

I did some testing and have come to these conclusions about what each one does.

Soft Tabs - Enabling this means it will use spaces by default (i.e. for new files).

Tab Length - How wide the tab character displays, or how many spaces are inserted for a tab if soft tabs is enabled.

Tab Type - This determines the indentation mode to use for existing files. If you set it to auto it will use the existing indentation (tabs or spaces). If you set it to soft or hard, it will force spaces or tabs regardless of the existing indentation. Best to leave this on auto.

Note: Soft = spaces, hard = tab

Solution 3:

Add this to your ~/.atom/config.cson

editor:
    tabLength: 4

Solution 4:

OS X:

  1. Go to Atom -> prefrences or CMD + ,

  2. Scroll down and select "Tab Length" that you prefer.

enter image description here