paste clipboard in vim code example
Example 1: paste vim
p
(use v to highlight, y to copy, p to paste)
Example 2: vim copy line
yy - Yank (copy) the current line, including the newline character.
3yy - Yank (copy) three lines, starting from the line where the cursor is positioned.
y$ - Yank (copy) everything from the cursor to the end of the line.
y^ - Yank (copy) everything from the cursor to the start of the line.
yw - Yank (copy) to the start of the next word.
yiw – Yank (copy) the current word.
y% - Yank (copy) to the matching character. By default supported pairs are (), {}, and []. Useful to copy text between matching brackets.
Example 3: copy from vim to clipboard
Use "+ to copy to the system clipboard
i.e. "+y instead of y
Likewise you can paste from "+ to get text from the system clipboard
i.e. "+p instead of p