cenos6.4安装gvim

Posted Dylan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cenos6.4安装gvim相关的知识,希望对你有一定的参考价值。

1. 下载gvim并解压

wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
tar -jxvf vim-7.4.tar.bz2

2. 进入解压后的vim74目录并运行配置命令

cd vim74  
./configure --enable-gui=auto --enable-cscope --enable-multibyte --enable-xim --enable-fontset --with-features=huge --with-x --prefix=/opt/vim74 

3. check是否安装libXt-dev和gtk2-devel包,上述命令如果是下述这样的,则需要安装

checking if X11 header files can be found... no
checking --enable-gui argument... no GUI support
checking X11/SM/SMlib.h usability... no
checking X11/SM/SMlib.h presence... no
checking for X11/SM/SMlib.h... no
no GUI selected; xim has been disabled
no GUI selected; fontset has been disabled

如果是X11是no,则安装libXt-dev和gtk2-devel包

yum install libXt-devel gtk2-devel

4. 重新运行命令并编译

./configure --enable-gui=auto --enable-cscope --enable-multibyte --enable-xim --enable-fontset --with-features=huge --with-x --prefix=/opt/vim74  
make  

运行后出现下述编译错误:

no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      Or specify the name of the library with --with-tlib.
make[1]: *** [config] Error 1
需要安装ncurses库:

yum install ncurses-devel.x86_64 

5. 重新运行命令并编译安装

./configure --enable-gui=auto --enable-cscope --enable-multibyte --enable-xim --enable-fontset --with-features=huge --with-x --prefix=/opt/vim74  
make  
make install

6. 添加vim74路径到path环境变量中

export PATH=$PATH:/opt/vim74/bin

 7. 卸载自带的vim72

rpm -qa|grep vim

vim-minimal-7.2.411-1.8.el6.x86_64
vim-enhanced-7.2.411-1.8.el6.x86_64
vim-common-7.2.411-1.8.el6.x86_64

rpm -e vim-minimal-7.2.411-1.8.el6.x86_64 vim-enhanced-7.2.411-1.8.el6.x86_64 vim-common-7.2.411-1.8.el6.x86_64 --nodeps

 

以上是关于cenos6.4安装gvim的主要内容,如果未能解决你的问题,请参考以下文章

在 Amazon AMI Linux 上安装 GVIM

GVIM安装手记

gVim 的安装以及配置

在 ubuntu 上全新安装 gvim。我应该把我的插件放在哪里?

Gvim插件管理只Vundle

windows上安装Gvim记录