VMware下CentOS安装成功后,默认自带vi,但vi功能没vim丰富。以下为CentOS中安装vim:

用yum产看源中的vim安装包:

[xi@localhost ~]$ yum search vim
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.jaist.ac.jp
* extras: ftp.jaist.ac.jp
* updates: ftp.jaist.ac.jp
=============================== N/S matched: vim ===============================
golang-vim.noarch : Vim plugins for Go
protobuf-vim.x86_64 : Vim syntax highlighting for Google Protocol Buffers
: descriptions
vim-X11.x86_64 : The VIM version of the vi editor for the X Window System
vim-common.x86_64 : The common files needed by any version of the VIM editor
vim-enhanced.x86_64 : A version of the VIM editor which includes recent
: enhancements
vim-filesystem.x86_64 : VIM filesystem layout
vim-minimal.x86_64 : A minimal version of the VIM editor Name and summary matches only, use "search all" for everything.

其中,vim编辑器需要安装三个包

vim-enhanced-7.0.109-7.el5
vim-minimal-7.0.109-7.el5
vim-common-7.0.109-7.el5

1. 查看本机已存在的vim包,确认一下vim包是否已经安装:

[xi@localhost ~]$ rpm -qa|grep vim
vim-minimal-7.4.160-1.el7.x86_64
vim-filesystem-7.4.160-1.el7.x86_64
vim-common-7.4.160-1.el7.x86_64
vim-enhanced-7.4.160-1.el7.x86_64

2.如果未出现以上的安装包,执行以下命令即可完成vim包的安装:

$ yum -y install vim*

3.测试vim包是否安装成功:

[xi@localhost ~]$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 10 2014 06:55:55)

--------------------------------------------------------------------------------------------------------------------------

P.S. vim编辑器环境配置:

是在用户登录的~目录下创建一个 .vimrc文件,在其中进行自己习惯的编程环境的设置,这样当别的用户使用时并不相互影响。

[xi@localhost ~]$ cd ~
[xi@localhost ~]$ ls
Desktop Documents Downloads Music Pictures Public Templates Videos
[xi@localhost ~]$ touch .vimrc
[xi@localhost ~]$ vim .vimrc

在.vimr c文件中输入以下内容:

set nu // 设置显示行号
set showmode //设置在命令行界面最下面显示当前模式等。
set ruler //设置在右下角显示光标所在的行数等信息
set autoindent // 设置每次单击Enter键后,光标移动到下一行时与上一行的起始字符对>齐
syntax on // 即设置语法检测,当编辑C或者Shell脚本时,关键字会用特殊颜色显示

CentOS安装vim的更多相关文章

  1. centos安装vim以及设置

    原文链接:http://www.xiaohuai.com/2884 Centos里的VI只默认安装了vim-minimal-7.x.所以无论是输入vi或者 vim查看文件,syntax功能都无法正常启 ...

  2. 在 CentOS 中编译安装 VIM 7.3

    转载:http://blog.csdn.net/zhanglyung/article/details/6204574 默认安装的 Vim 不带有多字符支持,所以不支持中文.无论是将 CentOS 本来 ...

  3. Centos中安装vim

    Centos, 默认没有安装VIM, 所以要当然要安装了, 直接yum install vim是不行的, 首先: yum install vim* 会看到vim-enhanced这个包,没错, 我们要 ...

  4. 在CentOS中编译安装VIM 7.3

    默认安装的 Vim 不带有多字符支持,所以不支持中文.无论是将 CentOS 本来的语系改为中文还是将 Vim 的语系设置改为中文,都不能正常显示中文.为了在 Vim 中能够正常处理中文,我们需要在编 ...

  5. CentOS 7 上安装vim(默认未安装)

    今天使用CentOS 7,发现未安装vim,所以重新安装 执行命令: yum -y install vim* 然后就可以使用了

  6. Centos 下安装VIM编辑器

    我们在安装完Centos后,它默认的是安装了VI编辑器,VIM是没有安装的,所以我们在使用vim test.txt时会提示: vim command not found ... 这就是说明我们的Lin ...

  7. centos 下 安装vim

    我们在安装完Centos后,它默认的是安装了VI编辑器,VIM是没有安装的,所以我们在使用vim test.txt时会提示: vim command not found ... 这就是说明我们的Lin ...

  8. Linux(centos)安装vim

    当在Linux环境下使用vim提示: vim command not found时,说明系统还没有安装vim. 安装步骤: 1.检查是否已安装 查看一下你本机已经存在的包,确认一下你的VIM是否已经安 ...

  9. CentOS 7 上安装vim 解決 centos -bash: vim: command not found

    用CentOS上使用vim竟然用不了,报错没有该命令 centos -bash: vim: command not found 那么如何安裝 vim 呢? ---------------------- ...

随机推荐

  1. BZOJ 3199 escape

    题目链接:http://www.lydsy.com:808/JudgeOnline/problem.php?id=3199 题意:给出n个点.对于平面上任意一点p,p到n个点中的哪个点的距离最近我们就 ...

  2. [CF724B]Batch Sort(暴力,思维)

    题目链接:http://codeforces.com/contest/724/problem/B 题意:给出n*m的数字阵,每行数都是1-m的全排列,最多可以交换2个数一次,整个矩阵可以交换两列一次. ...

  3. Building,Packaging,Deploying,and Administering Applications and Types

    buliding types into a module: response files: the IL disassembler:ILDasm.exe add assemblies to a pro ...

  4. ABAP Enhancement:第一部分

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  5. Get started with Gazebo in ROS

    Run Gazebo These three steps will run Gazebo with a default world. Install Gazebo. Open a terminal. ...

  6. Codeforces Round #377 (Div. 2) D. Exams 二分

    D. Exams time limit per test 1 second memory limit per test 256 megabytes input standard input outpu ...

  7. Zookeeper相关知识

    一.Zookeeper是什么? Zookeeper 分布式服务框架是 Apache Hadoop 的一个子项目,它主要是用来解决分布式应用中经常遇到的一些数据管理问题,如:统一命名服务.状态同步服务. ...

  8. Nginx简介及配置实用

    Nginx简介 Nginx是一个高性能的HTTP和反向代理服务器: 支持的操作系统众多,windows.linux. MacOS X: 可实现负载均衡: Rewrite功能强大: 电商架构大部分都采用 ...

  9. CSS的基本操作

    <html> <!-- . 给整个页面填一个一个背景 . 给em添加一个样式样倾斜效果消失 . 改变第一层UL的样式为蓝色,16px . 改变第二层的UL的样式为红色 14px . ...

  10. iOS - OC NSCache 缓存

    前言 NSCache 是苹果提供的一个专门用来做缓存的类,当内存 "不足" 或超过限制的时候,会自动清理缓存,使用时可以指定缓存的数量和成本.用法与 NSMutableDictio ...