How to install vim on centos

藏色散人
Release: 2020-03-19 13:52:00
Original
12670 people have browsed it

How to install vim on centos

How to install vim in centos?

When using vim in a Linux environment, the prompt: vim command not found means that vim has not been installed on the system.

Installation steps:

1. Check whether it is installed

Check the packages that already exist on your machine and confirm whether your VIM has been installed. Enter:

rpm -qa|grep vim
Copy after login

If it has been installed, it will be displayed:

[root@localhost usr]# rpm -qa|grep vim
vim-minimal-7.4.629-6.el7.x86_64
vim-filesystem-7.4.629-6.el7.x86_64
vim-enhanced-7.4.629-6.el7.x86_64
vim-common-7.4.629-6.el7.x86_64
vim-X11-7.4.629-6.el7.x86_64
Copy after login

2. Installation

If one of them is missing, for example: the vim-enhanced package is missing, then execute:

yum -y install vim-enhanced
Copy after login

It will automatically download and install. If none of the above three packages are displayed, enter the command directly:

yum -y install vim*
Copy after login

It will be installed automatically after executing the command. After completion, you can use the vim editor.

3. Configuration

After the installation is complete, start configuring vim

vim /etc/vimrc
Copy after login

After opening the file, press i to enter the edit mode, and then find a location to add the following code

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

After adding, press Esc, then enter

:wq

to exit and save.

Recommended video tutorial for learning Linux: //m.sbmmt.com/course/list/33.html

The above is the detailed content of How to install vim on centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!