Linux Learning (16) VIM

Source: Internet
Author: User
Tags file copy
First, Introduction

Vim is an enhanced version of VI. Vim is the main editor on the Linux platform. Basically all of the documents are added, modified, saved and need to be used. Therefore, it is necessary to master vim.

The installation of Vim is very simple and a single command is available:

Yum-y Install vim-enhanced

The operation of Vim is performed in three modes. They are: General mode, command mode, edit mode. In the general mode we can move the cursor, file copy and paste operations. In command mode, we can save files, exit, and find replacements. Write and modify files in edit mode.

The configuration file for Vim is in:/ETC/VIMRC. We can modify some of the vim configuration here.

Next we introduce the three modes of vim for each.

Second, the general mode

The main operations in general mode are:

2.1 Cursor Operation

Where h,l,k,j can be used in conjunction with numbers. For example, 3h means to move the cursor three characters to the left.

2.2 File Editing commands

Third, enter the editing mode

The way to enter edit mode from General mode is:

Four, command-line mode

Command-line mode typically begins with:

About the command: WQ, actually the command: X is very similar to its usage. These two functions are the same after the normal modification of the file. But if you just opened the file with vim, use: Wq will modify the file's Mtime, and: X will not.

V. Exercises and Answers

Linux Learning (16) VIM

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.