I have two strings in some file, e.g.:
string1
string2
And I want to get this:
string1string2
How can I do this most efficiently?
I have two strings in some file, e.g.:
string1
string2
And I want to get this:
string1string2
How can I do this most efficiently?
Shift-j (J) for "join" will move the line under the cursor up to the previous line. Note that this also inserts a space at the end of the line. If you type g Shift-j, no space will be appended when joining.
You can join multiple lines at once by highlighting them. For example, gg Shift-v Shift-g Shift-j ggVGJ will join all lines in the file.
You can refer to :help join in vim for more information.