Sublime Forum

Multiple Line Paste/Pivot append?

#1

I’m starting with General until I figure out if this is actually possible =)

Imagine the following document:

  1. Blah
  2. Blah
  3. Blah
    A) Blah
    B) Blah
    C) Blah
    (yeah, original, I know)

Is there a way to, with a single cut/paste, convert that to

  1. BlahA) Blah
  2. BlahB) Blah
  3. BlahC) Blah

I mean, I’ll do it manually because my list isn’t that long, and I’m not even sure if this is a common thing to need to do. I’m just flummoxed on what to even search on to see if it’s possible.

0 Likes

#2

Multiple cursor operations are the bread and butter of Sublime, so yes, this is totally possible.

What you want to do is select the A,B,C parts of the lines, and then convert it to a multiple selection; you can do that via the menu with Selection > Split into Lines or with the keypress Shift+Ctrl+L on Win/Linux or Shift+⌘+L Mac. Once that’s done you’ll have multiple cursors and multiple selections. You can then Do a cut, position as appropriate (below I did it manually but you probably want to skip to the line end to do it) and paste.

1 Like

#3

I knew it’d be in there somewhere.

The trick will be remembering this for the next blue moon when I have a similar need.

(ETA: I’m still not even sure what I should have searched on to find it.)

0 Likes