Vim Recall繁體中文

Delete back to the first line

dgg

Example

Normal 0 / 2
remove
these
keep
Cursor on line 2, column 1

Remove the current line and preceding lines.

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
1 Delete register 1
CharacterwiseEmpty
· space ⇥ tab ↵ line break
Before & after
Before
remove
these
keep
Cursor on line 2, column 1

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
1 Delete register 1
CharacterwiseEmpty
· space ⇥ tab ↵ line break
After
keep
Cursor on line 1, column 1

Vim registers

" Unnamed register Changed
Linewise · ↵ marks a line break · Uses Delete register 1remove↵ these↵
1 Delete register 1 Changed
Linewise · ↵ marks a line breakremove↵ these↵
· space ⇥ tab ↵ line break

Start in Normal mode, at line 2, column 1 (one-based). gg is linewise with this operator. Begin on the second line. Press dgg.

Details & Vim help

Example replayed in Vim

Remove the current line and preceding lines.

gg is linewise with this operator. Begin on the second line.