安裝 VIM 8.2 的依賴
yum install ruby ruby-devel lua lua-devel luajit \
ctags git python python-devel \
tcl-devel \
perl perl-devel libX* ncurses-devel gtk2-devel
git clone VIM 8.2 源碼
git clone https://github.com/vim/vim.git
配置編譯安裝源碼
cd 源碼目錄
./configure --with-features=huge \
--enable-fontset \
--enable-cscope \
--enable-multibyte \
--enable-pythoninterp \
--with-python-command=python \
--with-python-config-dir=/usr/lib64/python2.7/config \
--enable-luainterp \
--enable-rubyinterp \
--enable-multibyte \
--prefix=/usr/local/vim \
--with-compiledby="WenHang Yang"
make
make install
設置系統環境變量
echo "export PATH=\$PATH:/usr/local/vim/bin" >> /etc/profile
source /etc/profile
# 如果其他窗口或者重啓之後環境變量失效則做下面的操作
# bash
echo "source /etc/profile" >> /etc/bashrc
# zsh
echo "source /etc/profile" >> /etc/zshrc
VIM 8.2 安裝完成
cd ~
git clone https://github.com/spf13/spf13-vim.git
cd spf13-vim
./bootstrap.sh
# 如果中文亂碼,則在 ~/.vimrc.local 下加入下面配置
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
ctags 生成 tags
ctags --languages=php -R
打包 docker
docker commit server1 yangwenhang/centos7:vim
docker push yangwenhang/centos7:vim
下次不用折騰直接用
docker pull yangwenhang/centos7:vim
docker run -itd --name vim yangwenhang/centos7:vim
docker exec -it vim /bin/zsh
git clone 你的項目
cd 你的項目
# PHP語言
ctags --languages=php -R