Change tabs to spaces?


#1

I’m pretty new to Atom, but just recently I gave it a strong go, and damn, the git integration is so stellar. Probably the only thing keeping me from fully moving over from sublime is the fact that for some reason I can’t find out how to change tabs to spaces. I have soft tabs enabled, but this still produces tabs instead of spaces. Is there a vanilla way to do this or do I have to install some type of package for it?

Thanks!


#2

There are commands built in. If you open the Command Palette and search for “whitespace”, you’ll see the two commands.

Also, to solve your tab problem, go to the Settings View and scroll down to “Tab Type”. You can change it from auto to soft and then it will always insert soft tabs.


#3

For some reason this doesn’t work for me, I’ve restarted Atom and removed/readded the project to atom, but it still doesn’t work. I also have editorconfig set to use spaces, but it wasn’t working for me before I added that plugin. Any suggestions?

http://d.pr/v/SZs8


#4

Did you try closing all the open files and reopening them?


#5

Yeah, still nothing, is there nothing else I should be setting?


#6

Nope, those are the settings. Can you reproduce the issue in Safe Mode?

To launch Safe Mode:

  1. Completely exit all instances of Atom
  2. Launch Atom with the command atom --safe

#7

I launched it in safe mode and it’s still using tabs, settings are the same.


#8

Can you turn on “Show Invisibles” and make sure they are actually tabs?


#9

Sure, seems like they are.


#10

¯\_(ツ)_/¯ So if you:

  1. Have “Soft Tabs” enabled
  2. Have “Tab Type” set to “soft”
  3. Launch Atom in Safe Mode
  4. Replace all tabs with spaces
  5. Save the file
  6. Open the file

When you type new lines, it inserts tabs?


#11

Yeah, it still does tabs, if I go to the end of a line, however, and tab, it’ll give me spaces.


#12

I can’t reproduce the behavior you’re seeing. I’ve got one last thing to try:

  1. Close all open files
  2. Close all instances of Atom
  3. Execute the command: mv ~/.atom/storage ~/.atom/storage-backup
  4. Launch Atom with atom --safe