Sublime Forum

How to copy text and paste it in the same line, but to the right of the copied text?

#1

Hi all!

Tips needed to make work easier:

How to copy text and paste it in the same line, but to the right of the copied text?
Untitled%20Project

I spend a lot of time doing manual work :frowning:

You can watch the video. I tried to show in the video a few minutes of my work with the text

UPD
Lifehack for the last step - join lines > Ctrl+Shift+J Copy Column... Paste Line :+1:

0 Likes

#3

Hi TAIFUN,

Solution

To copy all lines to the end of the same line, you can do this:

  1. Ctrl-A or Selection > Select All - select all lines
  2. Ctrl-Shift-L or Selection > Split into Lines - create multiple selections, one per line
  3. Ctrl-C or Edit > Copy - copy multiple selections, each one line long
  4. Right Arrow or End - move to end of each line; also clears current selection
  5. Ctrl-V or Edit > Paste - paste text at the end of each line

If you want to copy only some lines:

  1. Place the cursor on the first line
  2. Ctrl-L or Selection > Expand Selection to Line to select entire line
  3. Repeat Ctrl-L to add additional line(s) to the selection
  4. Continue from Step 2 above

Other Tips

Note that:

  • Ctrl-L adds the line below the current line to the selection
  • Alt-L adds the line above the current line to the selection

If you work with files of comma-separated values frequently, check out the Advanced CSV package. With it, you can do things like select all of the values in the same column (Ctrl-, then S) even when the values are different widths on different lines.

In your video, you selected the same word (for example: “Ford”) on multiple lines with the mouse. You can also do this with the keyboard:

  1. Place the cursor in the first instance of the word
  2. Ctrl-D or Selection > Expand Selection to Word - to select entire word
  3. Repeat Ctrl-D to select more copies of the same word in the current document
3 Likes

#4

Thx a lot! :+1:

Unfortunately, this keyboard shortcut does not work for me on Windows.

0 Likes

#5

In what way does the Ctrl-D shortcut not work? Does pressing the key multiple times do nothing, select the wrong thing, or select only the first occurrence?

Ctrl-D should do something, as it is a built-in keyboard shortcut on Windows (unless you’ve overridden it with customizations).

Or does Sublime Text behave as expected, but my suggested technique does not solve your particular problem?

1 Like

#6

Probably another program intercepts this combination (Ctrl+D). But… The answer to my question was right in front of my nose. Thanks to your tip about Ctrl+Shift+L :pray::+1:

0 Likes