vim 在centos 升级 vim7.3 并且安装gvim

1.下载新版本的vim

查询一下:ncurses-devel ,如果没有这个软件,那么需要安装:yum -y install ncurses-devel

[root@localhost vim74]# rpm -qa ncurses-devel
ncurses-devel-5.7-4.20090207.el6.i686

否则在第三步出现:

no terminal library found
checking for tgetent()... configure: error: NOT FOUND!


先安装,第五步有说明

<strong><span style="color:#ff0000;">yum install libXt-devel gtk2-devel</span></strong>

cd /usr/local/src/
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2

2.解压 vim-7.3.tar.bz2

tar jxvf vim-7.3.tar.bz2 

3. 进入解压后的vim73目录,进行配置和安装

cd vim73
./configure --enable-gui=auto --enable-cscope --enable-multibyte --enable-xim --enable-fontset --with-features=huge --with-x --prefix=/usr/local/vim73 --enable-pythoninterp=yes
make
make install

4.配置和安装过程并没有报错,但是安装好后却发现只有vim,没有gvim。
使用vim --version或者在vim窗口输入:version,查看
/usr/local/vim73/bin/vim --version
--OR--
/usr/local/vim73/bin/vim
:version

-X11


5.回去发现configure的输出,:

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

6.继续上网查资料,发现是libXt-dev和gtk2-devel包没有安装,使用yum进行安装

yum install libXt-devel gtk2-devel

7. 删除刚才的安装并清空编译的中间文件

cd vim73
make uninstall
make clean
rm -f src/auto/config.cache

8.重新运行命令进行编译和安装

cd vim73
./configure --enable-gui=auto --enable-cscope --enable-multibyte --enable-xim --enable-fontset --with-features=huge --with-x --prefix=/usr/local/vim73
make
make install

9. 这次configure的输出:
checking if X11 header files can be found... yes
checking for _XdmcpAuthDoIt in -lXdmcp... yes
checking for IceOpenConnection in -lICE... yes
checking for XpmCreatePixmapFromData in -lXpm... yes
checking if X11 header files implicitly declare return values... no
checking size of wchar_t is 2 bytes... no
checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes
checking whether or not to look for GNOME... no
checking whether or not to look for Motif... yes
checking whether or not to look for Athena... yes
checking whether or not to look for neXtaw... yes
checking whether or not to look for Carbon... yes

10.执行以下命令进行链接以便识别vim命令,可以先备份 mv /usr/bin/vim /usr/bin/vim_bak

ln -s /usr/local/vim73/bin/vim /usr/bin/vim
ln -s /usr/local/vim73/bin/gvim /usr/bin/gvim


记录VIM安装一些笔记:

./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config-i386-linux-gnu/ --enable-perlinterp --enable-gui=gtk2 --enable-cscope --enable-luainterp --enable-perlinterp --enable-multibyte --prefix=/usr

需要重新配置可 输入 make distclean #清理一下上一次编译生成的所有文件


其中参数说明如下:


--with-features=huge:支持最大特性
--enable-rubyinterp:启用Vim对ruby编写的插件的支持
--enable-pythoninterp:启用Vim对python编写的插件的支持
--enable-luainterp:启用Vim对lua编写的插件的支持
--enable-perlinterp:启用Vim对perl编写的插件的支持
--enable-multibyte:多字节支持 可以在Vim中输入中文
--enable-cscope:Vim对cscope支持
--enable-gui=gtk2:gtk2支持,也可以使用gnome,表示生成gvim
--with-python-config-dir=/usr/lib/python2.7/config-i386-linux-gnu/ 指定 python 路径
--prefix=/usr:编译安装路径
sudo make VIMRUNTIMEDIR=/usr/share/vim/vim74



sudo make install

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值