VI command profile

xiaoxiao2021-03-06  89

VI

In general, in the VI editing environment, he has two modes: command mode, input mode;

In command mode you can complete, such as: Setting, Copy, Move, delete, replacement, block operation, write, save, lookup, etc., you can write any content in editing input mode;

Two mode switches: Switch from the edit mode to the command mode, press the ESC key;

---- Entering and leaving

---- To enter the VI can be directly connected to the system nodule, you can enter the VI , VI can automatically help you load the file you want to edit or open a new file. After entering the VI, the left side of the screen will appear in the wavy symbol. Anyone who has the first symbol will represent the table. To turn off the VI to type: q,: The WQ command is left after the deposit (Note Number). To switch to the instruction mode, use the [ESC] key, if you don't know what is still in the mode, you can use multiple [ESC], the system will emit a beep to determine the instruction mode.

---- VI input mold

Input mode command

Method for entering input and output

command

effect

Enter text after the cursor

Enter text at the end of the current row

Enter text before cursor

Enter text in the current row

Enter a new line after the current line

Enter a new line before the current row

Added (Append) ---- A From the rear of the cursor, the rear section is started, and the data after the light is moved backwards with the new information. ---- A from the place where the column of the column is started with new information.

Insert --- i From the scalar where you are in front of the position, the cursor is moved backwards with the new information. --- i Inserting information from the first non-empty white character front surface from the cursor column.

The opening (OPEN) ---- ??? o Add a column under the column of the cursor and enters the input mode. ---- ??? o Add a column in the column of the cursor and enters the input mode.

Command mode

---- - Delete and repair

---- What is the editor? In this case, we believe that the new modification and deletion of the text and delete, even the removal, replication, etc. of the text block. This will first introduce the VI how to do delete and modify. (Note: In the original concept of VI, the input and editing is

Two

Code child. Editing is in the command mode, first use the command to move the cursor to set the place where you want to edit, and then the command will be edited. )

command

effect

Delete the characters where the cursor is located

Delete the word where the cursor is located

Delete all characters in the cursor to the end

with

Delete the current line

?? You can add numbers before the command is deleted, such as <5X> means deleting 5 lines.

--- x Delete the cursor in the character. ---- DD Delete the column listed in the cursor. ---- r Reform the cursor in the character, and R will then fix the character. ---- R into the substantial state, the new information will cover the primary information until [ESC] is pressed back to the finger mode. ---- s Delete the cursor in the character, and enters the input mode. ---- S delete the column listed in the cursor and enter the input mold. Cursor motion command command

effect

Move to the beginning of the current word

Move to the end of the current word

Move a word forward

Move a character forward

Move upward

Move downward

Move a character backward

Change and replace operation command

command

effect

Replace the characters where the cursor is located

Replace the character sequence

Replace a word

with

Replace the previous character where the cursor is located

Replace all characters from the cursor position to the end

with

Replace the current line

Find (inquiry) command

command

effect

Query ABC forward

Backward query ABC

Continue to query forward

Continue to query backwards

Copy and paste command

command

effect

Copy the word where the cursor is located in the clipboard

Topping the cursor to the tail of the character to the clipboard

with

Copy the current row into the clipboard

Paste the content in the clipboard after the cursor

Paste the content in the clipboard in front of the cursor

File saving and exiting the VI command

command

effect

<: q>

Not stored exit

<: q!>

Not saving mandatory exit

<: w>

Save editing

<: w filename>

Deposit file filename

<: w! filename>

Mandatory deposit file filename

<: wq>

Save exit

<: x>

With <: wq>

With <: wq>

?

转载请注明原文地址:https://www.9cbs.com/read-122716.html

New Post(0)