Vim Recall繁體中文

Yank with a motion, trimming the ends of block rows

zy

Example

Normal 0 / 4
  ab  
  cd  
Cursor on line 1, column 1

Yank with a motion, trimming the ends of block rows.

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
0 Yank register 0
Characterwisesaved
· space ⇥ tab ↵ line break
Before & after
Before
  ab  
  cd  
Cursor on line 1, column 1

Vim registers

" Unnamed register
Characterwise · Uses Yank register 0saved
0 Yank register 0
Characterwisesaved
· space ⇥ tab ↵ line break
After
  ab  
  cd  
Cursor on line 1, column 1

Vim registers

" Unnamed register Changed
Blockwise · 5 · Uses Yank register 0··ab↵ ··cd
0 Yank register 0 Changed
Blockwise · 5··ab↵ ··cd
· space ⇥ tab ↵ line break

Start in Normal mode. Select a literal block, then yank it without trailing spaces. The exact block register is read from this Vim build.

Details & Vim help

Example replayed in Vim

In Normal mode, follow zy with a motion. In Visual mode, use it on the selection. For blockwise text, zy trims trailing spaces on each yanked row.