Vim Recall繁體中文

Join the selected lines without inserting spaces

gJ

Example

Visual line 0 / 1
  one
    two
keep
Cursor on line 2, column 1 · Line selection

Join the selected lines without inserting spaces.

Before & after
Before
  one
    two
keep
Cursor on line 2, column 1 · Line selection
After
  one    two
keep
Cursor on line 1, column 6

Start in Visual line mode. The highlighted area is observed in Vim. Any displayed register boxes show the exact copied or deleted contents.

Details & Vim help

Example replayed in Vim

Join the selected lines without inserting spaces. Use in Visual mode. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.