VI instruction description (Full Version)
. VI operation mode ================ VI provides two operation modes: insert mode and command mode ). When a user enters VI, that is, in the command mode, all the tokens entered by the user are considered as commands. In this mode, you can perform operations such as division and modification. To import data, you must enter the import mode.
. Inbound mode ========== how to enter the inbound Mode A (append) by adding resources after the game tag. A adds information to the end of the row. I (insert) adds information before the game tag. I adds data to the first part of the row. O (open) adds a new row under this row for storing incoming data. O adds a row above the row for storing incoming data.
How to enable the "ESC" mode to end the "ESC" mode.
. Command mode ========== move the game icon h to move one character to the left. J. Move one character up. K moves one character down. L move one character to the right. 0 to the beginning of the line $ to the end of the line. ^ Move to the first character of the line. H: Move to the first column of the rows window. M is moved to the middle column of the window. L move to the last column of the rows window. G is moved to the last column of the case. + Move to the first character in the next column. -Move to the first character in the previous column. (Move to the beginning of the sentence. (Limit 1) Move to the end of the sentence. {Move to the beginning of the paragraph. (Second)} Move to the end of the paragraph. Ng is moved to column N of the case. Column N after N + is moved to the position of the game tag. N-column N prior to the position of the game tag. <Ctrl> <G> the percentage of the rows shown in this example, the case name, the last row in the case, and the total row quota of the target row.
Sentence 1: Sentence (sentence) in VI refers 『!』 , "." Or 『?』 A string of words. Section 2: paragraph refers to text separated by blank lines in VI.
The. dialog box appears. <Ctrl> <B> when the window goes up, click Continue. <Ctrl> <D> the lower part of the window is half done. <Ctrl> <u> the upper half of the window goes up. <Ctrl> <E> click it to open a row. <Ctrl> <Y> click the upper window to open a line.
. Division, division, and modification instructions (this unit is rarely used) =======================================d (delete), C (change), and Y (Yank) the command format of such commands in VI is: Operator + scope = command (Operation operator) operation OPERATOR: D division command. However, the information will be deleted from the website to the computing environment. Y refers to materials (word groups, columns, sentences, or paragraphs) to the editing area. The P placement (Put) command is used and configured with D and Y. You can place the last delete or Yank information in the row and column where the game tag is located. The C Change command is similar to the combination of Delete and insert. Divide a word group, sentence, and other information, and insert new information.
Character character: E refers to the last character of the character string from the position of the game tag. W is the first character of the Next string from the position of the game tag. B is the first character of the previous string from the position of the game tag. $ The last character of the line from the location of the game tag. 0 indicates the first character in the line from the position of the game mark. The first character in the next sentence. (The first character of the sentence from the position of the game mark. {The last character from the position of the game logo to the paragraph. } The first character of the section from the position of the game logo.
The entire row is split by DD. D takes the line as a single digit, excluding all the characters of the travel standard. CC modifies the content of the entire row. The entire line of YY Yank enables the line of the game logo to be uploaded to the memory region.
. Escape and modify ============ x escape the character of the game tag. X. Divide the game tag by one word. Dd deletes the row where the game tag is located. R uses the character following this command to replace (replace) the character of the game tag. For example, RA replaces the character of a with. R enters and replaces zookeeper until ESC. S. Remove the character of the game tag and enter the inbound mode until ESC. S. Divide the information of the game tag and enter the inbound mode until ESC.
. Migration and transfer objects ========== use the delete and put commands to complete the migration of data. The Yank and put commands can be used to complete the object metadata. Yank and delete can distribute specified information to the memory region, and the PUT command can be used to upload the information in the memory region to the screen. Example: Move a row ‧ in this row dd ‧ move the game tag to the destination ‧ then row p then line ‧ in this row YY ‧ move the game tag to the destination ‧ then row p
. In command mode, you can add a number of characters to the front of the command. In this case, the command will be retained for n times. For example, in addition to 10 rows of ‧ 10dd, 10 rows of ‧ 10yy ‧ game are moved to the destination. ‧ P indicates that 10 rows of ‧ 10j are moved down.
. Cancel the content of the previous action (UNDO) ========================== that is, to cancel the content before the command on the original line.
The result of restoring the last command. U restores all changes to your game's goals.
. Search criteria ==== in VI, you can search for a field to move the game tag to that place.
/String to search for the string after the game tag. ? Search for the string before the game tag. N to locate the next same string. N to locate the next same string.
. Token join ============== the token of the J sentence. Route the next line of the target to the back of the target line.
If a row of information is too long, it can also be divided into two rows, as long as the game tag is moved to the opening point, into the ingress mode (A, I and other commands can be used) then press Enter.
. Setting of the Environment ==============: Set nu sets the row of the resource. : Set Nonu cancels the row setting. : Set AI self-motivation. : Set noai cancels the auto-inner token.
Automatic indentation when creating a file or program, you may encounter a need for internal modification ,『: set Ai provides the auto-inner feature. In the following example, we describe ‧ vi test) this is the test for auto indent "tab" Start indent restart: Set AI (Set auto indent) "tab" data "tab" data "tab" Data Metadata: set noai (cancel auto indent) The end of auto indent. ‧ escape: <Ctrl> <D> you can remove the Tab character.
. Ex command ======== submit data: W. Route the data in the selected region to the disk. : 10th million, 20th million data records from rows to rows are imported into the test results case. : 10th W> test adds the data from 20th rows to the end of the test case. : R test adds the information of the test case to the last of the zookeeper region.
Divide, analyze, and move: 10, 20 d divide the data of 10th to 20th rows. : 10 days (excluding 10th rows of data. : % D divide the entire region. : 10, 20co30: route the data from 10th rows to 20th rows to the end of 30th rows. : 10, 20mo30: Move the data from 10th rows to 20th rows to 30th rows.
The string search operator and the replacement of the S (substitute) command can be used to search for a row and column of the Operator. The G (global) command allows you to search for the resources in the entire region. The S command replaces the first character string with the character string of the condition. If the line contains several character strings of the character string, it can replace the first character, if you want to replace all strings, you need to add the number of GB. : 1, $ S/old/new/g. Change all "old" in the case to "new 』. : 10th S/^ // insert 5 blank spaces at the beginning of the row 20th to row. : % S/old/new/g change all "old" in the zookeeper region to "new 』.
. When the restore operation is completed, if the system fails or is being deleted, and the data in the region has not been restored to the disk, it is returned to the system again, you can run the following commands to retrieve the content in the previous example. % Vi-r filename
. Multiple cases ================== VI also provides the function of copying multiple cases at the same time. The method is as follows: % VI file1 file2 ..
After the repair of the first case is completed, you can use ": W" to save the region, and then use ": N" to merge it into the next case.
http://www2.nsysu.edu.tw/csmlab/unix/vi_command.htm