It’s logically consistent and it was designed that way by the developers. I’ve worked with Atom for years and I did have trouble with this behavior when I started (because I, too, came from other editors that behaved differently), but now I accept it and my copy/paste behavior has adapted to work with the behavior. It’s not “wrong” because it works according to a design. It’s just a different methodology than what you’re used to. Since Atom is so hackable, you have the option of writing a function to replace it if you really want to. I can tell you what you need to do if you want to pursue that, but I also think that you might be able to adapt and work around the issues to the point where how Atom treats copying indents can be used as a strength.
Having to copy, hit return and then paste is one more key stroke than I’d prefer. This is especially true if you are doing lots and lots of HTML data entry.
I agree. HTML data entry sucks and I try to automate it with JavaScript whenever possible. If that’s not available, then it’s nice when an editor has the tools to help you cut down on time spent on repetitive tasks. You know what’s a lot of work compared to a key stroke? Moving your mouse or shift-moving to select a certain number of rows. Copying and pasting kind of sucks as a repetitive task. That’s why the package emmet
exists. With emmet
, you can write out how you want your element tree to look and then the package will expand it, and you can include a lot of information in your instruction. Scope this example:
Now, emmet
has a weakness in that the tab navigation doesn’t highlight the sample text like Atom’s snippets
package does for any snippets you use, but snippets
requires that you define the inserted content ahead of time while emmet
lets you map it out on the fly. Reach your last tr
and realize you need another row? Press return and type tr>li{moar data!}*5
and you will have it in (at normal typing speeds) less time than it would have taken to laboriously select the previous row. Or maybe you do it one row at a time and just keep tr>li*5
on the clipboard and return, ctrl-c, tab for a three-key solution with the option to customize before you commit.
In terms of skill transferability, emmet
has sister extensions for a variety of editors, including Sublime, TextMate, and VS Code, among others.
How do you think that will work for you?