When editing with Vim on Macbook Pro with Iterm2 interface I can copy text by

  1. highlighting text with left-button double click on mouse,
  2. paste text by pressing center wheel on mouse.

Instead of (2) I would much prefer pasting the text by right-clicking the mouse button.

A related problem is that when highlighting the text in one window and pasting into another, the active window does not switch from window 1 to window 2; the active window remains window 1 but I would much prefer a switch to window 2.

Is there a way to fix these two problems?

closed as off-topic by Rich, Herb Wolfe, 8bittree, Martin Tournoij Nov 18 '17 at 1:39

  • This question does not appear to be about Vi and Vim family of editors, within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Also for remapping mouse buttons, keyboard shortcuts and so forth on a Mac, I highly highly recommend bettertouchtool.net (which is free). – Wildcard Oct 12 '15 at 6:42
  • 3
    I'm voting to close this question as off-topic because a). the copy/paste workflow you are currently using doesn't actually involve Vim: you're using iTerm 2's mouse interface for copy-pasting, b). as such the most appropriate place for changing this functionality is also outside of Vim (and is not actually possible using Vim configuration). – Rich Nov 15 '17 at 13:37
  1. Get yourself a proper Vim with clipboard support.

  2. Place the bundled mvim script somewhere in your $PATH.

  3. Add an alias to your ~/.bashrc or whatever init file is used by your shell:

    alias vim='/path/to/mvim -v'
  4. Use "+y and "+p to yank to and put from the system clipboard.

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