I have a bunch of vim commands that I keep in a file because I don't find them easy to remember.

I want to paste them into whatever vim session I'm running.

However, since upgrading to High Sierra, when I paste a vim command into a vim session, it adds the text as if I had asked it to insert the text!

Really, really annoying and I can't figure out how to make it accept the paste as if it were keyboard input.

Any ideas? Thanks!

  • 1
    Well, I have a decent workaround for now - if I type the : then after that the paste works as expected. Even I can remember the : bit :-) – Bruce Oct 28 '17 at 9:25

I don't seem to be able to upgrade to 'high sierra' so I can't confirm yet, but...

This sounds like it has to do with the :set mouse=a command. Type :set to view the current setting to the mouse= variable. There are a handful of modes for your mouse in vim. I think you want :set mouse=n. Type :help mouse in vim to see more info. Unfortunately I'm writing this on my phone and can't research/verify further. Hopefully :help mouse will give you the info you need to find the proper command to change your mouse behavior.

If :set mouse=n fixes your problem then add set mouse=n to your ~/.vimrc file. Same command, without the colon.

  • the output of :set is: :set --- Options --- backspace=2 modelines=0 scroll=11 ttyfast ttymouse=xterm2 window=0 fileencoding=utf-8 fileencodings=ucs-bom,utf-8,default,latin1 Any Ideas? – Samuel Åslund Apr 15 '19 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.