前端之家收集整理的这篇文章主要介绍了
从Ubuntu上的Vim切割到系统剪贴板,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用Ubuntu 12.04 Beta和Vim随之而来。我试图使用Vim将文本
文件的
内容复制到Chrome浏览器。
我试过,* y和所有的变种。我试图:set clipboard = unnamed和:set clipboard = unnamedplus。不工作。
我不是试图使用xclip,或GVim或任何这些。我试着用xclip(不是Ubuntu 12.04中的标准包),但是这也不工作,也太费力。
如何将文本复制到剪贴板,然后粘贴到任何地方,如Chrome?
@H_
404_6@
您的Vim版本
不支持X,这是剪贴板访问所必需的。默认情况下,Ubuntu发布了几个vim版本,只有GUI版本
支持剪贴板访问。我总是从源重新编译vim,以便单个vim(与gvim的符号
链接等)
支持所有需要的(
包括:gui从命令行切换到GUI版本)。这真的很容易做:
# Get the compile-dependencies of vim
sudo apt-get build-dep vim
# If you haven't got mercurial,get it
sudo apt-get install mercurial
# Get the source
hg clone https://vim.googlecode.com/hg/ vim_source
# Compile it
cd vim_source
./configure \
--enable-perlinterp=dynamic \
--enable-pythoninterp=dynamic \
--enable-rubyinterp=dynamic \
--enable-cscope \
--enable-gui=auto \
--enable-gtk2-check \
--enable-gnome-check \
--with-features=huge \
--with-x \
--with-compiledby="Your Name <youremail@domain.com>" \
--with-python-config-dir=/usr/lib/python2.7/config
make && sudo make install
这将安装在/ usr / local,所以确保它在你的PATH在/ usr之前,它将被使用,而不是Ubuntu版本。