Say I have the following code:
Hello
And I want to make it
Hello
There's a tag
text-object in vim:
:'<,'>
:'<,'>j
:help v_at
at "a tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", including the "<aaa>" and "</aaa>".
See |tag-blocks| about the details.
When used in Visual mode it is made characterwise.
One way when you won't need to repeat this action many times.
JxJx
Explanation:
J # Join current line with next one but substitute end of line with a space.
x # Remove the space.
Jx # Repeat same process for last line.
When standing anywhere in the second line (the one that says Hello
), press the following keys: ^d0vatgJ
. Simply explained:
H
If you start on the H
, you can skip the ^ part.