First several characters of clipboard deleted when pasting in Vim

vim

When I paste items into Vim, the first several characters are routinely missing. This has caused some serious errors. If I paste into gedit, for example, all lines are there. I can go back into Vim after a successful paste in gedit, with the same clipboard contents, and characters get deleted.

See the screenshot…vim starts at ta, whereas the gedit starts well before that. What is going on precisely with Vim???

to paste I've tried ctrl+V, ctrl+shift+insert, (COMMAND MODE) p and P.truncates clipboard

Best Answer

That's because vim is in command mode when you start it. Before pasting your code, you need to go into insert mode, for example, pressing the i key.

In your example, you are pasting your code as vim commands and when it reaches the first a in $cryptData enters insertion mode after current character.

If you are starting with vim: http://vim.wikia.com/wiki/Tutorial

Related Question