p (paste)
What is p (paste)?
p (paste): Vim: paste whatever is in the register after the cursor. In Vim, p pastes the content of the default register after the cursor, and P pastes it before. If you yanked or deleted a whole line, p pastes it on the line below. Vim's registers are more flexible than one clipboard. Every delete also goes into a register, which can surprise you: deleting a line after copying something replaces what you were about to paste. The register "0 always holds your last yank, so "0p pastes that even after deletes.
Frequently asked questions about p (paste)
What should you keep in mind with p (paste)?
To use the system clipboard, paste from the + register with "+p, provided your Vim build supports it. Many people add set clipboard=unnamedplus to their configuration so yank and paste work with the system clipboard directly, which makes Vim behave more like other applications.
At a glance
| Category | Keyboard shortcuts |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |