Preserve indentation level for Plain Text files


#1

I have the language-text package installed and the Auto Indent option in my Editor Settings is checked but I can’t seem to get Atom to maintain the indentation level for Plain Text files when I hit Enter. For example:

To do today:
  Look at Atom
  Look at CoffeeScript
|

The vertical slash in the code above is intended to represent the cursor after I’ve hit Enter to get to a new line. As you can see, it moves to the very beginning of the line when ideally it should preserve the indentation and instead be like this:

To do today:
  Look at Atom
  Look at CoffeeScript
  |

Indentation works for other file types – .rb, .js – but not for .txt files so how can I get this to work?


#2

I’m not sure, it works that way by default for me:

The cursor is a little hazy, but it is where it is expected to be.


#3

So what do you think might be causing this behavior? I noticed this was happening immediately after launching Atom for the first time since I have a todo.txt file that I like to check first every time I open any editor. Which settings should I be looking at that can possibly be the culprit?


#4

Well, you mention you have the language-text package installed. That should come by default, did you install it specifically?


#5

It came by default.


#6

Do you have the “Auto Indent” setting checked?


#7

Yes. It is checked.


#8

Could you give the following information?

  • Which version of Atom are you using?
  • What OS and version are you running?
  • Do you have Emmet installed?
  • Can you reproduce the issue after completely exiting Atom and restarting using atom --safe?

Also, if you go into the Settings View, search for the language-text package and click the background of the package tab, you can check to ensure that Auto Indent is also checked for Plain Text specifically:


#9

Atom Version: 1.0.2
OS: Ubuntu Linux 14.04
Emmet is installed
atom --safe reproduces the issue – there’s no change after restarting Atom with this flag
Auto Indent for the language-text package is indeed checked


#10

Can you try closing the file and reopening it? Or try a brand-new file?

Other than that, I’d recommend:

  1. Completely closing all instances of Atom
  2. Rename your ~/.atom directory to something else
  3. Start Atom again and see if that fixes it

#11

Same problem here :(.

Do you finally resolved the problem?

I have Auto Indent enabled in all places, I have tried with and without emmet, and by deleting the .atom directory. Same result: I have no auto indentation for plan text files (with or without extension .txt)

Thanks :).

EDIT: Forget what I said. It seems there is a problem with version 1.0.2. I’ve installed the version 1.0.19 and all is ok.

Thanks!