Vim Recall繁體中文

Delete the current line and three below

d3j

Example

Normal 0 / 2
one
two
three
four
five
Cursor on line 1, column 1

Apply a linewise downward motion to delete four lines.

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
1 Delete register 1
CharacterwiseEmpty
· space ⇥ tab ↵ line break
Before & after
Before
one
two
three
four
five
Cursor on line 1, column 1

Vim registers

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

Vim registers

" Unnamed register Changed
Linewise · ↵ marks a line break · Uses Delete register 1one↵ two↵ three↵ four↵
1 Delete register 1 Changed
Linewise · ↵ marks a line breakone↵ two↵ three↵ four↵
· space ⇥ tab ↵ line break

Start in Normal mode, at line 1, column 1 (one-based). j is linewise when used with d; the current line is included. Press d3j.

Details & Vim help

Example replayed in Vim

Apply a linewise downward motion to delete four lines.

In an unfolded buffer, this deletes the current line and up to three lines below. From the last line the motion fails. It also fails if the count goes past the last line and '-' is in 'cpoptions'.