Ubuntu 16.04 LTS - 无法在VIM中启用xterm_clipboard

4

我经常使用VIM,在以前我能够通过StackOverflow上的一个脚本提供的帖子来使+xterm_clipboard支持工作。我重新安装了Ubuntu系统,并从Ubuntu 14.04.4 LTS (Wily)迁移到了Ubuntu 16.04 LTS (Xenial)。

# 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

然而,这种方法已经不再可行,我无法使用"+y将缓冲区复制到系统剪贴板。我在.configure输出中没有看到任何明显的问题,但是每当我构建它时,vim --version总是显示-xterm_clipboard。我该如何解决这个问题?
1个回答

4

您应该已经注意到,提供的脚本生成的错误消息中不再使用Google Code通过mercurial (hg)托管源代码,而是迁移到了GitHub。

您需要使用新的源代码树,git,并且一些开发库需要事先安装。

代码清单(适用于Ubuntu 18.04及以上版本)


# Get the compile-dependencies of vim
sudo apt-get -y build-dep vim
# Install the "checkinstall" tool so the "make install" step is
# wrapped and the result is a .deb file that can be removed later by
# your package manager rather than having to hunt down every file deployed
# by "make install", which might not be possible if it overwrites existing
# system files.
sudo apt-get -y install checkinstall
# Install python dev
sudo apt-get -y install python3-dev
# Install xorg dev
sudo apt-get -y install xorg-dev
# Install git
sudo apt-get -y install git
# Get the source
git clone https://github.com/vim/vim.git vim_source
# Remove ./configure cache in case we have to run this twice due to permissions
# related issues.
rm vim_source/src/auto/config.cache
# Compile it
cd vim_source
make clean distclean
./configure \
    --enable-perlinterp=yes \
    --enable-python3interp=yes \
    --enable-rubyinterp=yes \
    --with-python3-command=python3.6 \
    --with-python3-config-dir=$(python3.6-config --configdir) \
    --enable-cscope \
    --enable-gui=auto \
    --enable-gtk2-check \
    --enable-gnome-check \
    --with-features=huge \
    --with-x \
    --with-compiledby="DevNull <darkstar@/dev/null>"
# Build quickly (parallel jobs).
make -j$(nproc)
# Need root to install
sudo checkinstall

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接