Is there a way to merge two contiguous lines on Vim in a way that the characters from…
- User
Is there a way to merge two contiguous lines on Vim in a way that the characters from one line occupy the same position (column) as the blank spaces on the followingh libne
- Assistant
Yes, in Vim, you can merge two lines in such a way that the non-blank characters from the second line fill in the blanks of the first line. This is a more unique task than simply concatenating lines, but you can achieve it with a little bit of Vim magic (using regular expressions and substitute commands).
Let's assume you have two lines like this:
abc def 123 456And you want to merge them to get:
abc123 def456Here's a step-by-step command sequence to achieve that: