Unix Command Encyclopedia

Source: Internet
Author: User
Tags exit insert save file

VI Full Screen Editor

VI (visual) is a visually-oriented Full-screen editor, divided into three different ways (mode):

Command mode:

Any input will be an edit command, and will not appear on the screen, if the input error there is a "cape" sound; Any input causes immediate reflection

Insert Method:

Any input data is placed in the edit register. Enter (I,a,a, etc.) in the command mode, enter the insert mode, press ESC when you insert, and jump back to the command mode.

Escape mode:

Instructions that are preceded by ":" or "/" appear on the bottom line of the screen, and any input is treated as a special instruction.

Enter VI (Type the following instruction at the system prompt below):

VI into VI without reading any documents

VI filename into VI and read the specified name of the file (new, old files can be).

VI +n filename enters VI and begins with the first few lines of the file.

VI +filename enters VI and is started by the last line of the file.

VI +/word filename enters VI and starts with the word word in the file.

VI filename (s) into VI and the designated documents listed on the list, the first document read first.

The Vedit enters VI and displays "INSERT mode" in the status line when the input mode is entered.

Edit several files (use VI filename (s)) to enter VI

: args display each file name in the Edit list

: n Read the next file in the Edit list

: Rew read into the first file in the Edit list

: e# read the previous file in the Edit list

: E file read into the other files into VI (this file is not in the editing list), packages files have not been archived, you should first: W archive.

: e! File forced to read another file into VI, the original file does not act as an archive.

Storage and Exit VI

: w filename in the specified file, but not exit VI (if not specified file name is the current working file name).

: Wq or: X or ZZ Save file, and Exit VI.

: Q do not make any changes and exit VI.

: q! Discard any modifications and exit VI.

:!command temporarily exit VI and execute shell instructions, and then return to VI after execution.

: Sh Temporary exit VI to the system, at the end of the CTRL + D is back to VI.

Add Data Instructions

I begin inserting characters at Guan position and press ESC at the end.

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.