Some basic applications of VIM

Source: Internet
Author: User

Vim text Compiler

VI is the default text compiler for Linux and Unix, and Vim is the enhanced version of VI

1, about Vim, there are three modes

Command mode: The default mode after the file is opened, can only view the contents of the file cannot be modified

Input mode: can edit and modify

Last-line mode: Used to save changes and exit

2. Switch

Command mode = = "Input mode press I key

Command mode = = "last line mode" Press: Key

Input mode and last line mode = = Command Mode press ESC

3. Vim filename (filename)

Open this file if filename is present

Create this file if filename does not exist

Experiment:

1. Create a new file in the/root/directory hello.sh

1.1, input content "Hello World!!!" ”

Press I into input mode after entering command mode

Notice the word "insert" below, which is the symbol for the input pattern.

1.2. Use cat command to confirm file contents after saving

2. Modify the System file/etc/hosts

2.1. Add a line at the end "127.0.0.1 www.baidu.com"

2.2. Use the ping command to test the connectivity of the www.baidu.com and observe the results


Some basic applications of 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.