Skip to content

Instantly share code, notes, and snippets.

@wfxr
Created April 11, 2017 04:17
Show Gist options
  • Save wfxr/35dd561bac74ecc706f0ed20016091ee to your computer and use it in GitHub Desktop.
Save wfxr/35dd561bac74ecc706f0ed20016091ee to your computer and use it in GitHub Desktop.
修复tmux中vim和系统共享剪贴板出错的问题
ref: https://github.com/tmux/tmux/issues/543
I was experiencing the same issues post-upgrade, but finally got it working again this morning.
Here's what I did:
brew install reattach-to-user-namespace
Ensure the following is set in .tmux.conf:
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
In .vimrc or ~/.config/nvim/init.vim (I use Neovim):
set clipboard=unnamed
Now all is well and I can copy/paste between system <-> vim sessions using vim keybindings and/or system ctrl+c / ctrl+p.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment