The default installed Vim does not have multi-character support, so Chinese is not supported. Whether to change the original CentOS language to Chinese or to change the language setting of Vim to Chinese, it is not possible to display Chinese correctly. In order to handle Chinese correctly in Vim, we need to specify the-enable-multibyte option at compile time. Below, I write my own process of compiling and installing Vim 7.3.
First of all, we need to get Vim source code. It can be downloaded from Vim's website at the address:
ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
Next unzip the resulting source bundle and go to the Unzip directory:
TAR-XJF vim-7.3.tar.bz2.
CD Vim73
We can then use the following command to view the configuration options and choose the appropriate parameters to suit your needs:
./configure–help
To configure:
./configure--enable-netbeans--enable-multibyte--enable-fontset--with-vim-name=vi--with-features=huge
Note 1: Generally speaking, we use VI to start VIM, so we need to specify--WITH-VIM-NAME=VI. By default, the name is vim after the installation. Of course, we can also specify aliases by alias, and then set the VIM alias to VI after installation.
NOTE 2: If the system does not have the SELinux development package installed, you will need to disable SELinux at the time of configuration, otherwise the compilation will be wrong. The configuration command should now look like this:
./configure--enable-netbeans--disable-selinux--enable-multibyte--enable-fontset--with-vim-name=vi-- With-features=huge
The final compilation of the installation is possible:
Make
Make install
Compiling and installing vim 7.3 in CentOS