Sublime Forum

Unique individual copy column paste feature

#1

Ok so this is what I want to do. I already know that you can select multiple lines and add one of the same thing to all those lines, anywhere you want. HOWEVER, what I want to do is I want to make a copy of my columns but insert it to the right. So for example I have a list of thousands of javascript objects. I want to add a property to each line. Each line will have the object name under the name property. For example:

object1
object 2

object n

I want each line to be repeated per line, so that on each line the same thing is repeated twice. So it’d be:

object 1 object 1
object 2 object 2

object n object n

Since this is javascript I would have to have perfect indention as well.

-Thank you

0 Likes

#2

You can do something like this:

What I did was:

  1. Select all lines that are interesting
  2. Press Shift+Ctrl+L to split the selection into lines
  3. Select just the objects part of the line by pressing Home, then Shift+End
  4. Copy with Ctrl+C
  5. Press End to clear the selection and jump to the end of the lines
  6. Press Space and Ctrl+C to duplicate

As long as each line is a complete object spec, this should work fine. For example. the text in the image could have been indented and this will still work. The length of each also does not matter since you’re skipping to the end of the line with a single key press.

2 Likes

#3

Thank you, you saved weeks worth of time :slight_smile:

0 Likes

#4

Also, look at Text Pastry :wink:

1 Like