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

标签 linux ubuntu vim ubuntu-16.04

我经常使用 VIM,并且之前已经能够获取 +xterm_clipboard support working by using a script provided in a separate post on StackOverflow.我已经在我的机器上重新安装了 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 。我该如何解决这个问题?

最佳答案

您应该已经注意到源代码不再通过 mercurial (hg) 托管在 Google 代码上,并且已在提供的脚本生成的错误消息中迁移到 GitHub。

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

代码 list (针对 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

关于linux - Ubuntu 16.04 LTS - 无法在 VIM 中启用 xterm_clipboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37079424/

相关文章:

vim - unite.vim file_rec/async 命令不可执行

c++ - 如何在 Linux (Ubuntu) 上获取 C/C++ 文档的完整路径

ubuntu - 使用 nginx 1.8.0、drupal 7 站点工作配置在 Ubuntu 14.04 上设置 SSL?

linux - Crontab 权限被拒绝

python - 为什么当我在 .ini 文件中使用 tComment VIM 插件时,它会添加/删除分号而不是散列作为注释?

vim - 如何在 vim 中拉取 X 个字符?

linux - 使用来自 Linux 的证书向 Azure 进行身份验证

未在嵌入式安装中设置 Python 路径

c# - Linux/Mono 上的 YSOD 故障排除

linux - 将合并行批处理脚本转换为 shell