redhat 装 vim

原地址  http://www.cnblogs.com/xiekeli/archive/2012/08/06/2624729.html


安装ncurses

./configure  --disable-selinux

在/etc/profile配置vim环境变量VIM,vimrc   synatx



1、下载vim源代码
vim的官方网站是:www.vmunix.com/vim
可以用这个链接下载源码包:

2、解压
将 /usr/src/vim-7.3.tar.bz2 文件解压缩在 /usr/local 底下

cd /usr/local
tar -xvf  /usr/src/vim-7.3.tar.bz2

3、配置(--disable-selinux 必须有   )

./configure --prefix=/usr/local/vim73 --with-x --enable-gui=gtk2  --with-features=big --disable-selinux --enable-multibyte
  • 这里如果没有“--disable selinux”configure的时候会报错:
 
          os_unix.c:45:30: 错误:selinux/selinux.h:没有那个文件或目录
          os_unix.c: In function ‘mch_copy_sec’:
          os_unix.c:2667: 警告:隐式声明函数 ‘is_selinux_enabled’
          os_unix.c:2671: 错误:‘security_context_t’ 未声明 (在此函数内第一次使用)
          os_unix.c:2671: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
          os_unix.c:2671: 错误:所在的函数内只报告一次。)
          os_unix.c:2671: 错误:expected ‘;’ before ‘from_context’
          os_unix.c:2672: 错误:expected ‘;’ before ‘to_context’
          os_unix.c:2674: 警告:隐式声明函数 ‘getfilecon’
          os_unix.c:2674: 错误:‘from_context’ 未声明 (在此函数内第一次使用)
          os_unix.c:2687: 错误:‘to_context’ 未声明 (在此函数内第一次使用)
          os_unix.c:2692: 警告:隐式声明函数 ‘freecon’
          os_unix.c:2697: 警告:隐式声明函数 ‘setfilecon’
          make[2]: *** [objects/os_unix.o] 错误 1
          make[2]: Leaving directory `/opt/bzip2/vim73/src'
          make[1]: *** [myself] 错误 2
          make[1]: Leaving directory `/opt/bzip2/vim73/src'
          make: *** [first] 错误 2
  • 如果没有安装ncurses这个库,configure的时候还是会报错:
          checking --with-tlib argument... empty: automatic terminal library selection
          checking for tgetent in -lncurses... no
          checking for tgetent in -ltermlib... no
          checking for tgetent in -ltermcap... no
          checking for tgetent in -lcurses... no
          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.
          
安装ncurses
          
yum  install  ncurses-devel

安装ncurses后重新configure:

 
 /configure --prefix=/usr/local/vim73 --with-x --enable-gui=gtk2  --with-features=big --disable-selinux --enable-multibyte

         

4、make/make install
 
     接下来执行:   make && make install 。现在你的Vim7.3就在 /usr/local/了 O(∩_∩)O~
 
5、建立链接
mv /usr/bin/vim /usr/bin/vim_backup           # 先将原来的备份
ln -s /usr/local/vim73/bin/vim /usr/bin/vim   # 再将vim 7.3链接过来

6、运行

当运行vim的时候,显示已经升级到最新版的7.3了

但是在执行gvim命令的时候,提示:

[root@localhost ~]# gvim
bash: /usr/bin/gvim: 没有那个文件或目录

是不是没有建立链接,

ln -s /usr/local/vim73/bin/gvim /usr/bin/gvim 还是不行

到/usr/local/vim73/bin/一看,根本没有gvim,真是不明白为什么。我的配置过程中明明加了--enable-gui=gtk2,过程中似乎没有什么提示啊。敬请高手指点!

最后还是装了老的版本:
yum install vim-X11

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值