The vim that comes with centos7.3 is version 7.4.*, YouCompleteMe requires Vim 7.4.1578+
I compiled and installed vim8.0 here
# Remove old version
sudo yum remove vim -y
# Install necessary components
sudo yum install ncurses-devel python-devel -y
# Download source code, compile and install
git clone https://github.com/vim/vim.git
cd vim/src
# Set compilation parameters according to your actual situation
. /configure --with-features=huge --enable-pythoninterp=yes --enable-cscope --enable-fontset --with-python-config-dir=/usr/lib64/python2.7/config --enable-python3interp=yes --with-python-config-dir=/usr/lib/python3.6/config --enable-multibyte --prefix=/usr/local/vim/
make -j2 && make install
Compilation parameter description:
Note: You must bring Python compilation plug-in support, preferably the Python path, otherwise this error will be reported when using: YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.6+) support
After the installation is complete, vim is installed in /usr/local/vim/bin, add environment variables, and add this directory to the PATH to facilitate terminal global use
[ root@aiker ~]# cat /etc/profile.d/vim.sh
export PATH=$PATH:/usr/local/vim/bin/
View version and support information:
[ root@aiker ~]# vim --version
VIM - Vi IMproved 8.1(2018 May 18, compiled Aug 20201803:23:45)
Included patches:1-299
Compiled by root@aiker
Huge version without GUI. Features included(+) or not(-):+acl +extra_search +mouse_netterm +tag_old_static
+ arabic +farsi +mouse_sgr -tag_any_white
+ autocmd +file_in_path -mouse_sysmouse -tcl
+ autochdir +find_in_path +mouse_urxvt +termguicolors
- autoservername +float +mouse_xterm +terminal
- balloon_eval +folding +multi_byte +terminfo
+ balloon_eval_term -footer +multi_lang +termresponse
- browse +fork()-mzscheme +textobjects
++ builtin_terms +gettext +netbeans_intg +timers
+ byte_offset -hangul_input +num64 +title
+ channel +iconv +packages -toolbar
+ cindent +insert_expand +path_extra +user_commands
- clientserver +job -perl +vartabs
- clipboard +jumplist +persistent_undo +vertsplit
+ cmdline_compl +keymap +postscript +virtualedit
+ cmdline_hist +lambda +printer +visual
+ cmdline_info +langmap +profile +visualextra
+ comments +libcall +python +viminfo
+ conceal +linebreak -python3 +vreplace
+ cryptv +lispindent +quickfix +wildignore
+ cscope +listcmds +reltime +wildmenu
+ cursorbind +localmap +rightleft +windows
+ cursorshape -lua -ruby +writebackup
+ dialog_con +menu +scrollbind -X11
+ diff +mksession +signs -xfontset
+ digraphs +modify_fname +smartindent -xim
- dnd +mouse +startuptime -xpm
- ebcdic -mouseshape +statusline -xsmp
+ emacs_tags +mouse_dec -sun_workshop -xterm_clipboard
+ eval -mouse_gpm +syntax -xterm_save
+ ex_extra -mouse_jsbterm +tag_binary
system vimrc file:"$VIM/vimrc"
user vimrc file:"$HOME/.vimrc"
2 nd user vimrc file:"~/.vim/vimrc"
user exrc file:"$HOME/.exrc"
defaults file:"$VIMRUNTIME/defaults.vim"
fall-back for $VIM:"/usr/local/vim/share/vim"
Compilation: gcc -std=gnu99 -c -I.-Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -std=gnu99 -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -ldl -L/usr/lib64/python2.7/config -lpython2.7-lpthread -ldl -lutil -lm -Xlinker -export-dynamic
Install the application:
pip install pep8 flake8 pyflakes isort yapf autopep8 powerline-status
Vundle is a plug-in management tool for Vim, official document: https://github.com/VundleVim/Vundle.vim
The installation steps are simple:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
I use monokai color scheme here: https://github.com/sickill/vim-monokai
Download the corresponding monokai.vim file and put it in ~/.vim/colors/
mkdir ~/.vim/colors
wget -O ~/.vim/colors/monokai.vim https://raw.githubusercontent.com/sickill/vim-monokai/master/colors/monokai.vim
Clone my github .vimrc
git clone https://github.com/donxan/vim_python_IDE.git
Open any vim editing window, use the command mode to type the following commands to achieve the corresponding function
: PluginList -List all configured plugins
: PluginInstall -Install plugin,Append`!`To update or use
: PluginUpdate:PluginSearch foo -Search for foo;Append`!`Clear local cache
: PluginClean -Clear unused plugins,need confirmation;Append`!`Automatically approve the removal of unused plugins
: h vundle for more details and wiki and FAQ
Or through the following quick installation:
vim +PluginInstall +qall
Add clang: add C language family syntax completion function
sudo yum install cmake -y
cd ~/.vim/plugin/YouCompleteMe
. /install.py --clang-completer
possible problems:
The ycmd server SHUT DOWN(restart with':YcmRestartServer').
Unexpected error while loading the YCM core library.
Use the ':YcmToggleLogs' command to check the logs.
python YouCompleteMe/install.py --clang-completer --racer-completer
curl -sSf https://static.rust-lang.org/rustup.sh | sh
Retry the above step 1 after successful installation
The effect is as follows:
Recommended Posts