It looks like you're not in insert mode when you're pasting, so Vim interprets the text as commands, until one letter (e.g. i
or o
) accidentally switches to insert mode. [1]
You need to go into insert mode first (i
, also consider :set paste
, and the 'pastetoggle'
option; :help 'paste'
has some background information).
Or (when supported), access the clipboard from within Vim, e.g. via "+p
(normal mode) or <C-R><C-R>+
(insert mode).
As only the terminal-based versions of Vim have this problem of differentiating between typed and pasted keys, switching to the GUI GVIM (I think called MacVim there) would avoid this problem, too.
[1] Vim understands the example as:
Fu
: backward find characteru
n
: next search matchcti
: change until before the next characteri
(which aborts insert mode when there's no such character)o
: new line below the cursor and insert text