One of the things I love about Vim is the visual block mode, especially column copy/paste.
I’ve been using Sublime for a while, and I always forget the easiest way to do this.
So now that I’ve got it figured out once more, I’m writing this so I don’t forget.
The general idea is this:
- Copy a column of text. And remember how many lines are selected.
- Create multiple cursors where you want to paste. (Has to be the exact same number of lines as #1.)
- (If in vintage mode, go to ‘insert’ mode.)
- Paste
However, I don’t want to count lines if I’m just going to paste somewhere else in the same set of lines.
So below is what works for me.
Caveat: I’m using Sublime 3, in vintage mode, on Windows 7. So your mileage may vary.
These steps are to do one thing fast, copy a column of text from anywhere to somewhere else in the same set of lines. Like perhaps the end of the line.
- Select the block of text to copy. (For me, this is with the middle mouse button) (mac: option+left mouse button)
- Copy with Edit->Copy, or Ctrl+C
- Yank, in vintage mode, this is ‘y’. This is unnecessary for the yank effect. The side effect, though is to un-select, and get back to multiple cursers.
- Now position the cursors where you want to paste. Vintage mode: 0 for beginning of line, $ for end of line.
- ‘i’ or ‘a’ to get into ‘insert’ mode.
- Paste. Edit->Paste, or Ctrl+V.
This works for me.
I’d like to know how to do it without the unnecessary ‘yank’.