CenOs 7源码安装Vim Vim bundle YouCompleteMe

CenOs 7源码安装Vim Vim bundle YouCompleteMe

实验环境

VMware® Workstation 12 Pro 12.0.0 build-2985596

MobaXterm 20.2

CentOS Linux release 7.8.2003 (Core)

参考https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source

1. 安装Vim

1.1 移除旧版本

yum remove vi vim -y

1.2 安装工具

yum install -y ruby ruby-devel lua lua-devel luajit \
luajit-devel ctags git python python-devel \
python3 python3-devel tcl-devel \
perl perl-devel perl-ExtUtils-ParseXS \
perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \
perl-ExtUtils-Embed

1.3 克隆项目

原项目地址https://github.com/ycm-core/YouCompleteMe.git

导入到gitee加速下载

cd /opt
git clone https://gitee.com/lsqypro/vim.git

1.4 安装配置

需要安装Python3 参考

cd vim
./configure --with-features=huge \
            --enable-multibyte \
            --enable-rubyinterp=yes \
            --enable-python3interp=yes \
            --with-python3-config-dir=$(python3-config --configdir) \
            --enable-perlinterp=yes \
            --enable-luainterp=yes \
            --enable-gui=gtk2 \
            --enable-cscope \
            --prefix=/usr/local
make VIMRUNTIMEDIR=/usr/local/share/vim/vim82 && make install         

2. 安装配置Vim bundle

2.1 克隆项目

原项目地址https://github.com/VundleVim/Vundle.vim.git

git clone https://gitee.com/lsqypro/Vundle.vim.git ~/.vim/bundle/Vundle.vim

2.2 编写配置文件~/.vimrc即可

.vimrc文件内容:

set nocompatible				" 去除VI一致性,必须
filetype off					" 必须

" 设置包括vundle和初始化相关的runtime path
set rtp+=~/.vim/bundle/Vundle.vim

" 自定义插件开始
call vundle#begin()				" 必须

Plugin 'VundleVim/Vundle.vim'

" 自定义插件结束
call vundle#end()				" 必须

filetype plugin indent on		" 必须 加载vim自带和插件相应的语法和文件类型相关脚本

3. 安装YouCompleteMe

3.1 克隆项目

原项目地址https://github.com/VundleVim/Vundle.vim.git

cd ~/.vim/bundle/
git clone https://gitee.com/lsqypro/YouCompleteMe.git

3.3 安装

cd ~/.vim/bundle/YouCompleteMe
git submodule update --init --recursive

等待几分钟

python3 install.py --clangd-completer

3.4 修改~/.vim文件如下

set nocompatible				" 去除VI一致性,必须
filetype off					" 必须

" 设置包括vundle和初始化相关的runtime path
set rtp+=~/.vim/bundle/Vundle.vim

" 自定义插件开始
call vundle#begin()				" 必须

Plugin 'VundleVim/Vundle.vim'
" YouCompleteMe:语句补全插件
set runtimepath+=~/.vim/bundle/YouCompleteMe

" 自定义插件结束
call vundle#end()				" 必须

filetype plugin indent on		" 必须 加载vim自带和插件相应的语法和文件类型相关脚本
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值