VIM Editor ::: Cutting, Copying, Yanking, Deleting and Pasting in Vim
In Vim, cutting and copying rely on two different commands:
d
in Vim means delete, in other editors, this might be named, cut.y
in Vim means yank, in other editors, this might be named, copy.
Therefore, in Vim to perform a Cut & Paste operation:
- Position your cursor where you wish to start your cut.
- Press
v
to select characters, or uppercaseV
to select whole lines, orCtrl-v
to select rectangle blocks(useCtrl-q>
ifCtrl-v
is mapped to paste). - Move your cursor to where you wish to end your selection.
- Press
d
to cut ory
to copy. - Move cursor to where you wish to paste your selection.
- Press
P
to paste before your cursor’s location, orp
to paste after your cursor’s lcoation.
Source: