How to paste vim command into vim editor on mac

3

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!

Bruce

Posted 2017-10-28T09:13:57.503

Reputation: 161

1Well, 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 – 2017-10-28T09:25:06.503

Answers

0

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.

CoreyJJohnson

Posted 2017-10-28T09:13:57.503

Reputation: 126

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 – 2019-04-15T11:11:56.313