Centos7 uses vim to build powerful pyt

Compile and upgrade vim

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

Install Vundle and YouCompleteMe

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

Add color theme scheme

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

Install plugin###

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

Append

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.
  1. Reinstall YouCompleteMe
python YouCompleteMe/install.py --clang-completer --racer-completer
  1. If an exception occurs during the YouCompleteMe installation
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

Centos7 uses vim to build powerful pyt
ubuntu16.04 build vim and pyt
CentOS uses Nginx to build a download function server
Centos6 method steps to build gitlab
(1) Centos7 installation to build a cluster environment
Centos8 uses yum to install mongodb 4.2 method
Centos7 uses yum to install pip, ipython
How to quickly build Nginx server under CentOS
Centos7 uses yum to install Apache, mariadb, PHP
CentOS7 build jenkins
Centos build lnmp
Centos7 build python3.8.5+scrapy+gerapy
Centos7 tutorial to build a master-slave DNS server
Centos7 uses LVM to achieve dynamic expansion method
How to build a LAMP environment on centos7.2
Centos7.2 compile and install way to build phpMyAdmin
Centos7 uses Ansible to install Chinese fonts in batches
3 minutes to teach you to build gitea on Centos server
Use Rancher to build a K8s cluster under CentOS7
Centos8 implementation steps to build a local web server
CentOS build private git
Linux (centos7) build gitlab
Build k8s1.9.9 on centos7
Centos 6.4 python 2.6 upgrade to 2.7
CentOS6.7 build LNMP environment
Centos6.9 build rabbitmq 3.6.8 cluster
Centos 6.4 python 2.6 upgrade to 2.7
Centos7.6 build LNMP environment
Centos7 build Kubernetes cluster
CentOS6.5 upgrade kernel to 3.10.28
Jenkins build on centos
Build Hadoop in CentOS
Centos7 build DNS service
CentOS 5 to CentOS 5.8 YUM source
CentOS 7 build LNMP environment
First try to build a Ceph storage cluster on Centos7