为什么要写这篇呢?

因为我的工作环境 vi 可以用,但vi 编辑某些脚本不能显示语法高亮,所以。。。

[root@node1 sbin]# vim /etc/init.d/snmpd
-bash: vim: command not found
[root@node1 sbin]# rpm -qa|grep vim
vim-minimal-7.0.109-6.el5
[root@node1 sbin]# yum install -y vim-common vim-enhanced
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirror.esocc.com
 * base: mirror.esocc.com
 * epel: mirrors.yun-idc.com
 * extras: mirror.esocc.com
 * updates: mirror.esocc.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vim-common.i386 2:7.0.109-7.2.el5 set to be updated
---> Package vim-enhanced.i386 2:7.0.109-7.2.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================
 Package                     Arch                Version                          Repository           Size
============================================================================================================
Installing:
 vim-common                  i386                2:7.0.109-7.2.el5                base                6.4 M
 vim-enhanced                i386                2:7.0.109-7.2.el5                base                1.2 M
Transaction Summary
============================================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)
Total download size: 7.7 M
Downloading Packages:
(1/2): vim-enhanced-7.0.109-7.2.el5.i386.rpm                                         | 1.2 MB     00:00   
(2/2): vim-common-7.0.109-7.2.el5.i386.rpm                                           | 6.4 MB     00:00   
------------------------------------------------------------------------------------------------------------
Total                                                                       5.4 MB/s | 7.7 MB     00:01   
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : vim-common                                                                           1/2
  Installing     : vim-enhanced                                                                         2/2
Installed:
  vim-common.i386 2:7.0.109-7.2.el5                   vim-enhanced.i386 2:7.0.109-7.2.el5                
Complete!


好了,重新使用vim 编译一下,当然如果需要语法高亮的话,SecureCRT的登陆终端类型要修改为Linux或者ASCII,然后把显示语法高亮的两个勾子都打上,退出终端重新登陆即可,OK !