Is cutting and pasting from a vim session started from tmux completely broke?
If I want to cut from a github web into my vim session or vice versa, it rarely works or if it does, it is completely broke.
I have had others confirm that they find this difficult.
I am running on the following:
I am referring to the normal cut and paste commands Cmd + c and Cmd + v.
Are there any fixes or workarounds?
In Vim, you don't use Cmd+c/Cmd+v to "copy" and "paste": you use y
/p
, possibly with a register ("*y
/"ap
) to "yank" and "put".
If your Vim has clipboard support built-in, "*y
should be enough to yank from Vim and "*p
should be enough to put from another application. *
is the "clipboard" register.
Again, supposing Vim has clipboard support, adding set clipboard^=unnamed
to your ~/.vimrc
should synchronize Vim's default register and the clipboard register; allowing you to simply use y
˘and p
.
The tmux/vim combo has a long standing issue with system clipboard on Mac OS X. It is fortunately very quick and easy to fix.
To see if your Vim build has clipboard support, type this command in your shell:
$ vim --version | grep clipboard
A +
before a feature means "supports", -
means "doesn't support".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With