Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every time the visual selection changes in MacVim, it is copied to the system clipboard. Is this normal and can it be disabled?

share|improve this question
up vote 6 down vote accepted

This isn't the default behaviour of MacVim but it can be activated by using set guioptions+=a or set go+=a. Then everything you select will be copied to your clipboard. Maybe you have that line in your .vimrc.

To deactivate it, simply use set go-=a or add it to your .vimrc.

share|improve this answer
Thanks, that was it. I had the following in my vimrc, can't remember why: set guioptions=aAce – DavidNorth Oct 19 '11 at 18:41

What do you mean by

Every time the visual selection changes


Do you select foo in foo bar and get foo in the clipboard then change your mind and select bar instead and find bar in place of foo in the clipboard?

If yes I never encountered this behaviour in MacVim or any other native MacOS X app.

It may happen in GVim on Linux where there are more than one clipboard (one of them containing selected text) but even there it will depend on how it was compiled.

Do you find foo in the clipboard after changing it to bar?

If yes that is totally normal: changing a string with p or c always puts the original in the default register which corresponds to the system clipboard in MacVim.

One way to bypass this "problem" is to use "_dP instead of p. It means "delete the selected text into the 'blackhole register' ("_d) then put the content of the default register before the cursor".

You could use a similar strategy for c: "_di will do the same but put you in INSERT mode instead.

share|improve this answer
Literaly every change to the visual selection updates the OS X system clipboard without making any edits. – DavidNorth Oct 19 '11 at 18:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .