Why does VIM paste 1 line below where expected?

vi, vim

Solution

Use `P`. It will paste above the cursor instead of below.

Problem

A simple recipe to demonstrate the behavior of pasting in Vim/Vi... - Run vim - Enter insert mode - Add 3 different lines of garbage to your file - Exit insert mode (press escape) - Move the caret to the second line - Enter the command `dd` (delete line) - Enter the command `p` (paste) Notice the pasted line is inserted below where you might expect it to be placed. Why is Vim/Vi programmed with this behavior, and is there any way to change it? (ie: Have the line pasted one line above the default position.)

Original source