Vim Installation and Configuration

Source: Internet
Author: User

Installation and configuration of the Linux operating system vim

Installation of Vim

VI is the most established Linux editing tools, and Vim is the upgrade version of VI, Linux system must ah.

1. Press the TAB key after typing "VI" on the command line and you can see that only VI and Vim.tiny are installed in the current system. Vim is a text editor developed from VI that is more powerful. And Vim.tiny is a lite version of Vim, so it's imperative to install Vim

2.ubuntu system: Normal user under input command: sudo apt-get install VIM-GTK CentOS System: Normal user under input command: yum-y install vim*

Pictures with Ubuntu as an example

3. Here, enter "Y" and return.

4. Do not need any action afterwards, wait for the installation to complete. After the installation is complete, enter VI at the command line and press the TAB key. As you can see, there is already a vim command in existence. The installation was successful.

Configuration of Vim

Just installed Vim, perhaps the interface is not very friendly, which requires us to change the vim configuration file, according to our needs to modify it.

Under command line, enter the command: sudo vim/etc/vim/vimrc

You must add sudo, otherwise you are not authorized to edit VIMRC.

In this document, there is a sentence:

Syntax on

It means syntax highlighting, and if you're commented out, please "let it out." Just like in the show

Vim configuration for small series.

Please enter them in the last line of your vim to make your vim more beautiful and comfortable.

Set Nu//on the left line number

Set TabStop//tab length to 4 # Linux normal user after entering terminal, set vim./VIMRC, enter set nu set tabstop=4, is a simple way to configure VIM

Set nobackup//Overwrite files without backup

Set Cursorline//Highlight when forward

Set ruler//display status line at cursor position in lower right corner

Set autoindent//Auto Indent

After saving, the configuration is complete. The above configuration, in fact, is very simple, such as some color scheme, and so on, small and not written, if you have other needs, suggest Baidu.

OK, let's write a small program, as shown, it can be seen that the interface has been more beautiful, at least the small part of him to write programs, read documents, or feel very friendly.

Vim Installation and Configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.