VI command list (reproduced)

xiaoxiao2021-03-05  30

The text editor is the most commonly used tool in all computer systems. The editor under UNIX has EX, SED and VI, etc., where the most widely used is VI, and the VI command has a lot of commands. There is not much summary in this area, and the following summarizes, share! Desire correction and supplement! 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, perform the editing of the mobile 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 Move a row J or Ctrl N: cursor down one line ENTER: cursor down one line W or W: cursor right shift one word to the first B or B: Cursor left shift one word to the header E or E: cursor right One word to the word tail): The cursor is moved to the end (: the cursor moves to the sentence): The cursor is moved to the beginning of the paragraph {: the cursor moved to the end NG: cursor to the first N : cursor minus N row n : The cursor is moved to the N row n $: the cursor is moved to the N-row h: cursor moved to the screen top line M: cursor moved to the screen L: cursor moved to the screen last line 0: (Note is a number zero) cursor Move to the current list $: cursor move to the current row screen roll roll class command Ctrl u: Turn half screen to the file Ctrl D: Tail of the file half screen Ctrl f: Tail the file to the file Ctrl B; File The first screen NZ: rolls the nth row to the top of the screen, and roll the current row to the top of the screen when not specified.

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 to delete the NDW or NDW: Delete the cursor start and the N-1 word do: Delement to the lead D $: Delete to the end NDD: Delete the current Row and after the N-1 line X or X: Delete a character, X delete the cursor, and the X deletes the ctrl u: The text search input in the input mode and the replacement command / pattern: start from the cursor Search Pattern? Pattern: Pattern: Pattern: Pattern N from 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: Will All P1 is replaced by P2: N1, N2S / P2 / G: Use all P1 in the ninth to N2 to replace: g / p1 / s // p2 / g: use all P1 in the file P2 Replacement Option Setting All: Lists All Options Settings Term: Set Terminal Type IgnoRance: ignore the case in the search List: Show actions (Ctrl i) and the row flag ($) Number: Display line number Report: Displaying the number of commands modified by row TERSE: Show short warning information WARN: If you do not save the current file when you go to another file, the NO WRITE information is displayed Nomagic: Allows in the search mode, using 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: N1, N2 CO N3: Will N1 The content between the N2 lines is copied to the N2 line: N1, N2 m N3: Move the content between N1 lines to N2 line to Nth line: N1, N2 D: Wide N1 to N2 Content Delete: W: Save 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 the shell command Command: N1, N2 W! Command: Use the contents of the N1 lines to N2 as the input of the Command as the input of Command and execute. Do not specify N1, N2, indicating the input of the entire file as a Command: r! Command: Place the output of command Command in the current row register operation "? NYY: Save the contents of the current row and the N row to the register ? In this, it is a letter, n is a number "?" NYW: Save the current line and the n word to the register? Where? Is a letter, N is a number "? NYL:

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

New Post(0)