Step-by-step Unix - VI Edit Program Getting Started (3) VI Touch

zhaozj2021-02-16  126

Http://91mail.51.net provides ?? Need a complete PDF document to http://91mail.51.net download

1. Overview of UNIX System Editor * Ed: The original row editor in the UNIX system. * EX: Row Editor, is an expansion of the ED editor. * VI: Full-screen editor, the main editor of the UNIX system, which is also a supercoming ED. * Emacs: full-screen editor, not part of UNIX system version 4, is a separate editor. 3.1, the launch of VI and exit 1, the launch input vi command of the VI, enter the full screen editing environment, the status of this is command mode. 1 VI cursten in the first line of the first line of the buffer 2 VI EXAMPLE optical label set in the first line of the buffer first line 3 VI EXAMPLE optical label fixed in the file last line first column position 4 Vi n EXAMPLE cursor Located in the location of the NP line (N: for the number) 5 VI / STRING EXAMPLE cursor positioning in the file, the first time String, the first position, the first position of the string String, the application method * VI's name is taken from Visual. * There are two ways of operation: command mode, insert mode, and EX escalation mode * In order to entered in command mode, lowercase is sensitive.

Second, the start and exit (continued) 2, the VI's exit recommendation first typed "ESC" key to ensure that the status of the current VI is command, enter the following command, exit the VI. 1: W Write the contents of the edit buffer to file: Q Exit VI 2: WQ will be completed by the above two steps can be completed. 3: X function is the same. 4: Q Exit VI, the text at this time is not changed. 5: Q! Forcibly exit the VI, so that the update content does not write back the file.

Third, the cursor moves the comment word in the window: is a letter sequence separated by a space or punctuation symbol. Sentence: The character sequence ended in the end of the sentence (.), Question mark (?) Or exclamation mark (!) Is separated from two spaces or a carriage return. Paragraph: There is one or more blank lines before and after a paragraph.

Third, the cursor moves in the window (continued) 1, characters and lines mobile command results ------------------ ↑ or K moved up to the row ↓ or j move down One line ← or h or escape key left shift a character → or L or space right shift a character o Move to the beginning of the current line to move to the end of the current row or the carriagemill moves to the beginning of the next line - move to The beginning of a row, move the cursor in the window (continued) 2, other units of mobile command results -------------------- w moves to One word or punctuation S movement to the next word E Move to this word or punctuation end E M move to the next end of the word b Back to the word or punctuation start B The start of the transfer to the word moved to the beginning of the next sentence (moved to the start} of this sentence) to the next paragraph start {Move to this paragraph on the previous start four, move the window command result in the buffer ---- - ------------------ Ctrl-f forward (on) Move a full screen Ctrl-D forward (on) mobile half screen Ctrl-B backward (below ) Move a full-screen CTRL-U backward (below) Move half-screen H cursor moves to the top M cursor to move to the middle of the screen L

The cursor moves to the bottom of the screen Note that the number N is added to the digital N as a prefix, so that the corresponding command is executed n times. But Ng makes the cursor in the Nth line. 5. The result of the movement command of the cursor in the body -------------------- G cursor moves to the NG cursor to the file NG cursor to move to the file : 0 Cursor moving to the file 1 line: 1 Code Move to the file 1 line: N cigarette moves to the file NAST: $ cursor Move to the file / String cursor moves forward to String head? String cursor Move back to String Sixth, increase the original command result ---------------------------- A will enter text insertion After the cursor, a will enter the text in the current row of the current row i. Insert the text into the cursor. I will enter the text into the start of the current row. The new line O will open a new line O will be in the current line. Open a new line of row at the top and a line Note Esc: Make the edit state from the input mode to the command party Seven, modify the original command result ---- ---------------------------------- r Replace Current characters, no need to press ESC. R Replaces the current character, until the ESC button. NC replaces the N row character starting from the current character until the ESC key is typed. NC $ with NC. NCW replaces the N word starting with the current character until the ESC key is typed. Note N is a number, and it can be omitted for 1.

Seven, modify the original (continued) Command results ---- -------------------------------- NCC pair The N row character starting at the current character is replaced until the ESC button is typed. Ns replaces n characters starting from the current character until the ESC key is typed. NS replaces N-line characters starting from the current row until the ESC key is typed. J connects the current line and the next line. Note N is a number, and it can be omitted for 1. 8. Delete the original 1. x and x command usage command ---- --------------------------- Delete Current characters. Nx deletes n characters starting from the current character. X Delete the previous character of the current character. Nx deletes the first n characters of the current character. Note N is a number, and it can be omitted for 1. 8. Delete the original (continued) 2. The use of D command is used to delete the text within the specified range and store the buffer. Command Results ---- ---------------------------- NDW delete N words starting with the current word. ND $ deletes N row characters starting with current characters. NDD deletes N rows starting from the current row. D and D $ synonym. D) Delete the beginning of the next sentence. D} deletes the beginning of the next paragraph. D Enter to delete two lines. Nine, mobile and copying the original 1. M command to move the text of the specified range to the specified location. The format is as follows: , M Example :: 3, 14 m 56: 7, 52 m 0

2. The use of the T command copies the text of the specified range to the specified location. The format is as follows: T Example: 1, 14 t 60 7, 52 t $ 9, mobile and copying original (continued) 3. Ye and y command Copy the text of the specified range to the buffer, but do not delete its content. Command Results ---- ---------------------------- NYW copy from the n word starting from the current character; NY $ replication From the n-line character starting from the current character; y and y $ synonym; y) to the beginning of the next sentence; y} is copied to the beginning of the next paragraph; NYY replication N row starting from the current row; Y car copy two lines ; Ten, repeat and cancel the results of the command ---- ------------------------------------- -. Repeat the command executed last time. U Cancel the final change or delete. U Cancel all the modifications to the current row. P Restores the content in the current buffer. If the content in the buffer is a complete information, it is placed in a new line below the current row; otherwise put the contents of the buffer to the right of the cursor position. P with P operation. When recovering a tribute information, put a new line above the current line; otherwise, put it on the left of the cursor position. : E! Re-edit. Abandoning all modifications made by this document, reading the file from the disk and starting editing. Eleven, retrieving and replacement command results ---- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- / String Retrieve string string from the current position, and position the cursor in the string start position (retrieved backwards). • String Retrieves string string from the current location and positions the cursor in the string start position (retrieved forward.). // Repeat the previous retrieval command, but the direction is retrieved. ?? Repeat the previous retrieval command, but the direction is to retrieve. N Repeat the previous retrieval command, regardless of its retrieval direction. That is, the retrieval direction is unchanged). N Repeat the previous retrieval command, but retrieve the direction of retrieval. : G / String Retrieve string string, the cursor is positioned in the first retrieved String office.

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

New Post(0)