Normalize indent on paste doesn't work as expected


With the default “Normalize Indent on Paste” option, indent-on-paste doesn’t work as expected for me.

If I have a file with some indented lines like:


And then I select the entire line “bar”, then copy, then paste, I get:


I would expect it to keep the indentation, but it goes back to the beginning of the line.

If I turn off “Normalize Indent on Paste”, this works as expected.

Copy/paste loses indentation?
normalizeIndentOnPaste disables autoIndentOnPaste
Is Paste Broken or am I dumb?

Hi Jason,

I got hit by this one too.
Is ‘normalizeIndentOnPaste’ enabled in your editor’s config?
When both ‘normalizeIndentOnPaste’ and ‘autoIndentOnPaste’ are switched on I noticed that ‘autoIndentOnPaste’ does not work anymore.

My choice is ‘autoIndentOnPaste’:
so here is what my Config looks like:

  'autoIndentOnPaste': true
  'normalizeIndentOnPaste': false

Here is the bug report: normalizeIndentOnPaste disables autoIndentOnPaste

I hope this helps,


Huh. In the settings view, I see an “Auto indent” option, but not “Auto indent on paste”. I didn’t even try turning off auto-indent since it seemed too obviously useful.

In fact, audoIndentOnPaste seems to only be relevant to an older version of Atom—it’s not in the latest docs:


Hey good point I was staring at an older doc. I am up to date with 0.73.
So I removed the line with the obsolete ‘autoIndentOnPaste’ that makes no difference.

If ‘normalizeIndentOnPaste’ is on then I get the behaviour you describe.
When it is false then the pasted line keeps its spaces and tabs at the beginning.

Not as much as I was hoping for with the ‘autoIndentOnPaste’ but my favorite setting for now.



Wow. Turning off normalizeIndentOnPaste actually makes me want to use Atom again! Excellent?

All this time I was slowly being driven mad by all the extra manual indenting I was having to perform post-paste.

So, what’s the use case for this setting? When is it useful to turn on? Why is it on by default?

CoffeeScript auto-indent broken?

For anyone wondering where the setting is, it’s here…

OK, I have had it

the option should be: Remove Indent On Paste


thanks, added that to config.cson works like a charm

  'normalizeIndentOnPaste': false


This is unbelievable. Why is this not built-in? How do we fix this issue??


This is still an issue, and nothing here fixes it. Every time I copy/paste code to and from any file, the indentation is always messed up.

As a sidenote: look how many views this post has. This is ridiculous and needs to be fixed.


Unable to find a workaround for this issue, a good example would the “Paste and Indent” feature from Sublime. With a shortcut you are able to paste and indent the copy as expected.


Still awaiting a fix.


I think the feature was working previously (around Atom 1.4).
Now (1.4.3), when I cut a function declaration (for example), then paste it elsewhere at the same level, I get my snippet indented by two levels!

Ah, I guess it blindly adds the current indentation level to all the pasted lines, without checking if these lines are already indented!
I will stick to set the setting to false. Too bad, as this can be useful in some cases.

Note: indenting with 4 spaces, auto indenting detection (tab type: auto), auto-indenting on typing.


Still doesn’t work for simple JS files.


hey, just switched to Atom from Sublime. Is this still an issue? Cause it looks like there is no way to paste with normalised indentation so far :confused:


If you have “Auto Indent on Paste” selected, your pasted text will be indented at the level of the line before it.


Can’t say I understand why, but if I use this custom snippet keeping autoIndentOnPaste: true the situation gets actually better, even if it should change nothing:

atom.commands.add 'atom-text-editor',
  'user:paste-and-indent': (event) ->
    editor = atom.workspace.getActiveTextEditor()
      select: true # This selects just-pasted text, just an additional feature, you can disable safely


  'cmd-v': 'user:paste-and-indent'


  'normalizeIndentOnPaste': false

PS: the normalizeIndentOnPaste config option is no longer existent.