参考:
1 Vim的终极配置方案,完美的写代码界面! ——.vimrc
3 Ubuntu20.04安装YouCompleteMe自动补齐插件 (推荐)
其中的git路径可改为:git clone https://github.com/ycm-core/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe
# Linux配置vim环境
## 安装插件环境以及各种插件
- 前置安装git,cmake,python3
- 安装vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- 配置~/.vimrc
set nocompatible
filetype off " on
set rtp+=~/.vim/bundle/Vundle.vim
" vundle initialize
call vundle#begin()
" github repo plugin, should be the first, let vundle manager
" plugin version
" format Plugin 'user/plugin repo name'
Plugin 'VundleVim/Vundle.vim'
Plugin 'ycm-core/YouCompleteMe'
call vundle#end()
- 安装YouCompleteMe
# 该速度很慢,可直接通过git下载源码
$vim
:BundleInstall (或PluginInstall)
# 直接通过git下载源码
git clone https://github.com/ycm-core/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe
# ModuleNotFoundError: No module named 'setuptools'
sudo apt-get install python-setuptools python3-setuptools
# ERROR: Python headers are missing in /usr/include/python3.8.
sudo apt-get install build-essential cmake python3-dev
" enter ~/.vim/bundle/YouCompleteMe
git submodule update --init --recursive
cd ~/.vim/bundle/YouCompleteMe
python3 ./install.py --clangd-completer
- 编译(需要C/C++语言补全支持,要加--clangd-completer, 不需要提前下好clang