0

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?

2
  • Also for remapping mouse buttons, keyboard shortcuts and so forth on a Mac, I highly highly recommend bettertouchtool.net (which is free).
    – Wildcard
    Commented Oct 12, 2015 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
    Commented Nov 15, 2017 at 13:37

1 Answer 1

1
  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.