J
The
Command
The J command in Vim
Command
join lines
Join — append the next line to the end of the current line, replacing the newline with a single space. Use
gJ to join without adding a space.Examples
J3J(join 3 lines)gJ(join without space)
Reference
Learn every Vim command visually — right in your browser.
Add Vim What? to Chrome — FreeAlso on Firefox.
Related commands