Linux-VI User Guide

Source: Internet
Author: User
I believe that friends who have used Linux will not be unfamiliar with vi. It is the most common full-screen editor in Linux. However, we generally use
Microsoft products were first introduced to users, and the methods for using edit in DOS and notepad in windows were different. Therefore, new Linux users thought VI was hard to use and even hard to use.
Next I will introduce how to use VI.
Note that VI is divided into two states: command status and edit status. In command status, the system processes the entered characters as commands, for example: Q indicates exit, while editing is used to input text. When you enter VI, it first enters the command status. Now I have a basic understanding of vi. If you are interested, please continue to look at it.

To enter VI, directly Type VI at the system prompt
<File Name>: when you type an existing file name, the system automatically opens the file. Otherwise, a new file is created. At this time, you will see a wavy line on the left of the screen ~, This indicates
This row is empty and has no text. Now the system is in the Command state. How can I switch to the edit state and enter text? Press the Insert key on the disk. In this case, we can use the same editor as other editors.
After editing the text, the function key is similar to other editors. Below are some descriptions of the function key, isn't it easy?
========================================================== ==============================
Description function key
========================================================== ==============================
Move the cursor to the front home of the row
Move the cursor to the end of the row
Page down
Page up
Delete Cursor Position Character Delete
Delete the character backspace before the cursor position
Move cursor →
========================================================== ==============================

In addition, VI also supports Pasting and copying, but it is very troublesome to use a keyboard. Which computer does not have a mouse? Like in Windows, you can drag the mouse from the start point to the end point,
This area is reversed, move the cursor to the position you want to paste, and press the middle mouse button to complete the paste (If your mouse has two keys, at the same time, press the left and right keys to simulate the Three-key middle mouse ).
WINDOS. Some may ask, how can we find it? Next we press the ESC key on the disk to switch to the command status and enter "? <The string you want to search for> "(No
With quotation marks), and "/<the string you want to search for>" indicates to search up, N indicates to repeat once on the keyboard, and N indicates to repeat in the opposite direction.
After half a day, your file may have been edited, but how can I save it? Now we are still in the Command state. Press W and press enter to save the disk. The command to exit VI and return to Linux is Q. These two commands can also be used in combination, for example, WQ indicates that the disk is exited.
Well, after talking about it for a long time, your head may be too big. The above mentioned are only the most common functions in VI. You can learn about other functions in use. By the way, do not remember those commands. They seem to be too many and unregular. If you use them a few times, you will naturally become proficient. Now I think it is much more convenient than notepad in windows.

Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 1325870

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.