- Prep the initial multiline by for instance adding padding (e.g. on the right side of numbers)
- Select the multiline text you would like to copy
- Go to the first line
- Enter visual block mode (Ctrl + v or q)
- Move to the last line
- Go to the end of the line (Shift + 4)
- Cut it (d)
- Paste the initial multiline text to target multiline text
- Move cursor to the first line of the target text
- When inserting, account for the padding (Shift + a - goes in to insert mode at the end of the line)
- Exit insert mode (Ctrl + [ or Esc)
- Paste (p)
Last active
January 4, 2024 11:17
-
-
Save ErykDarnowski/90f7cf237c0f98b87aa1d41b8647202b to your computer and use it in GitHub Desktop.
Copy multiple lines of text in front of other multiple lines of text in Vim
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment