Join lines without changing spaces
gJ
Example
Normal 0 / 1Normal 1 / 1red
blueCursor on line 1, column 1red blueCursor on line 1, column 4Remove the newline without adjusting whitespace.
Remove the newline without adjusting whitespace
Before & after
red
blueCursor on line 1, column 1red blueCursor on line 1, column 4Start in Normal mode. Cursor starts on r. Press gJ; the two original leading spaces remain.
Details & Vim help
Example replayed in Vim
Remove the newline without adjusting whitespace.
gJ joins the current and next line without adding spaces or removing indentation. A count joins that many lines, with a minimum of two.