I’ll not paste in the :help
section here because that would be 10 times more
than the whole advent of vim 2021 series and it would make them look scarier
than they are.
This is basically the copy-paste or vim.
d
: Delete. It’s actually Cut because it deletes the content, but put it into a register at the same time.c
: Change (Day 3)y
: Yank = Copy (but it is a black sheep).p
: Paste
This will be a very light touch on them, they will come up later a lot and it’s better to clear things up.
What can I do with these?
Double them
If you repeat the same key, it means “do it on the whole line”.
dd
: Delete the current line.cc
: Change current line.yy
: Yank the current line.pp
: Nope, not you. It does not even make sense.
Upper case letter
With their upper-case partner, you can operate on the line from the position of the cursor. It’s not true, only two of them does this.
D
: From the cursor, delete rest of the line.C
: From the cursor, change rest of the line.Y
: Nope, not you. It’s the same asyy
, but you can give it a number.P
: Nope, not you. It does not even make sense.
Black sheep
Paste does not operate on “line” with upper case letter, but changes the behavior.
p
: Insert after cursor or under the current line if we have whole line(s) in the register.P
: Insert before cursor or above the current line if we have whole line(s) in the register.]p
: Insert content after, and do the indentation magic. It is useful if you want to paste in a code block, but you want it to be indented as they should be.[p
: same as]p
, but paste it “before”.