Delete back to the first line
dgg
Example
Normal 0 / 2Operator pending 1 / 2Normal 2 / 2remove
these
keepCursor on line 2, column 1remove
these
keepCursor on line 2, column 1keepCursor on line 1, column 1Remove the current line and preceding lines.
Vim registers
"Unnamed register- Characterwise · Uses Yank register 0
saved 1Delete register 1- Characterwise
Empty
Waiting for motion or text object
Vim registers
"Unnamed register- Characterwise · Uses Yank register 0
saved 1Delete register 1- Characterwise
Empty
Remove the current line and preceding lines
Vim registers
"Unnamed register Changed- Linewise · ↵ marks a line break · Uses Delete register 1
remove↵ these↵ 1Delete register 1 Changed- Linewise · ↵ marks a line break
remove↵ these↵
Before & after
remove
these
keepCursor on line 2, column 1Vim registers
"Unnamed register- Characterwise · Uses Yank register 0
saved 1Delete register 1- Characterwise
Empty
keepCursor on line 1, column 1Vim registers
"Unnamed register Changed- Linewise · ↵ marks a line break · Uses Delete register 1
remove↵ these↵ 1Delete register 1 Changed- Linewise · ↵ marks a line break
remove↵ these↵
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.