ubuntu的vim:
sudo apt-get install vim-gtk
mac:
brew install vim
需要配置下 .vimrc
set clipboard=unnamed
mac os x中x11的安装:
https://support.apple.com/zh-cn/HT5293
步骤:
- configure OSX X11 to share the clipboard
- forward X11 between OSX and server
- use vim compiled with +xterm_clipboard
- optional: 'set clipboard=unnamedplus' to use system clipboard for default operations.
It sounds like you were using a version of vim compiled without +xterm_clipboard. You can check viavim --version | grep xterm_clipboard
. I havevim-nox
andvim-gtk
installed on my ubuntu server.
Details here: [http://www.lowlevelmanager.com/2012/09/osx-remote-vim-clipboard-sync.html](http://www.lowlevelmanager.com/2012/09/osx-remote-vim-clipboard-sync.html)
.ssh/config类似下面的配置:
Host home
ForwardX11 yes
ForwardX11Trusted yes
Hostname 10.0.0.7
User ubuntu
mac下的x11的设置需勾选下:
选中Pasteboard下的tab下的: Update Pasteboard immediately when new text is selected
如果ssh主机很慢, 可以在.bash_profile下配置下DISPLAY环境变量, 具体值如下设置:
xauth list
找到类似 losthost:0 这样的值设置即可(有的电脑不是这样的值)