Enter the command vi filename: Open or create a file, set the cursor on the first line of the first line VI N filename: Open the file, and place the cursor in the first line of the first VI filename: Open the file, and place the cursor The last line, the first VI / PATTERN FileName: Open the file and place the cursor in the first string of Pattern Match vi -r filename: The system crashes when using VI editing, restore FileName Vi FileName ... .filename: Open multiple files and edit in turn
Move the cursor class command h: Cursor left shift a character L: Cursor right shift a character Space: Cursor right shift a character backspace: Cursor left shift a character k or Ctrl P: cursor to move a row J or CTRL N: cursor Move a row ENTER: Move a row of W or W: Cursor right shift one word to the head b or B: Cursor left shift one word to the header E or E: cursor right shift one word to the word): Code moves to the sentence Tail (: cursor moved to the beginning}: The cursor moved to the beginning of the paragraph {: cursor to the paragraph end NG: cursor to the first N : cursor minus N row N-line N-line N-row N $: cursor Move to the N-row H: Cursor Move to the screen Top M: Cursor Move to the screen L: The cursor is moved to the screen last line 0: (Note is a number zero) cursor moved to the current line $: Current to the current Row
Screen roll class command Ctrl u: Topping half screen Ctrl D: Take the file tail, half-screen Ctrl f: Tailing the file Ctrl b; send a screen NZ to the file: Rolling the NZ The top of the screen is not specified, and the current row is rolled to the top of the screen.
Insert text class command i: In the cursor before I: in the current list A: Cursor after the cursor, A: in the current line O: newly opened in the current line O: newly opened on the current line R: Replace the current character R: Replace the current character and the following characters until pressing the ESC key S: starts from the current cursor location, replacing the specified number of characters S: Delete the specified number of rows, and replaced NCW in the input text or NCW: Modify the specified number of words NCC: Modify the specified number of rows
Delete Command NDW or NDW: Delete the cursor starts and the N-1 word do: Delete to Line D $: Delete the NDD: Delete the current row and the N-1 line X or X: Delete one Character, X delete the cursor, and X deletes Ctrl U: Delete the text entered in the input mode
Search and replacement command / pattern: Search Pattern? Pattern from the cursor starts Pattern? Pattern: Search Pattern N from the start of the cursor starts Pattern N: Repeat the last search command in the same direction N: Repeat the last search command in the reverse direction: s / p1 / p2 / g: Alternative to all P1 in the current line: N1, N2S / P2 / G: Replace all P1 in the nth to N2 lines: g / p1 / s // p2 / g: Replace all P1 in the file is replaced with P2
Option Settings All: List all option settings TERM: Set Terminal Type Ignorance: ignore the case in the search List: Display Bit (Ctrl i) and Right Sign ($) Number: Display Brand Route Report: Display The number of line-oriented commands modified: Show short warning information WARN: If you do not save the current file when you transfer to other files, the NO WRITE information is displayed Nomagic: Allow in the search mode, use the front without "/" Special Character NOWRAPSCAN: Prohibiting VI When searching at both ends of the file, starting MESG from the other end: Allow VI to display other users to write the information on their own terminals to the last mode command: N1, N2 CO N3: Row N1 The content between the N2 rows is copied to the N13: N1, N2 M N3: Move the content between N1 lines to N2 line to Nth line: N1, N2 D: Between N1 lines to N2 lines Content Delete: W: Save Current File: W New_FileName: Some Current File: E FileName: Open File FileName Edit: X: Save the current file and exit: Q: Exit VI: Q !: Do not save the file and exit VI:! Command: Execute Shell Command Command: N1, N2 W! Command: Use the contents of the N1 lines into the N2 line as the input of Command and execute, if N1, N2 is not specified, indicating the input of the entire file as a Command: R! Command: Put the output of the command command to the current line
Register operation "? NYY: Save the contents of the current row and the N row to the register? Where? Is a letter, n is a number"? "NYW: Save the current line and the n word to the register? Middle, among them? For a letter, n is a number "? NYL: Save the current line and the n characters to the register? Where? Is it a letter, n is a number"? P: Take the register? The content is placed in the cursor position. Here? Can be a letter, or a number NDD: delete the current line and its total N line text, and put the deleted content into the No. 1 delete register.