Today I made a macro that involved selecting a few lines to join. The problem was that sometimes I only selected parts of one line and in this case two lines was still joined with J
. Is it possible to avoid this?
So with which key combination can I do these two transformations: (<
and >
indicates selection)
content <of line 1
content of> line 2
Should be joined like this after pressing gJ
:
content of line 1content of line2
And this
all <content on> one line
Should stay the same after pressing gJ
. For now it joins the current line with the next one which is not what I want.
vnoremap gJ :join!<CR>
– Matt May 12 '20 at 5:25