Vi Command

xiaoxiao2021-03-06  110

The editor under Unix has EX, SED and VI, etc. The most widely used VI, and the vi command is more, when you use it, you don't use it, but when you are familiar with the following command, you will appreciate it. It is the advantage. Enter the command vi filename: Open or create a file, and place the cursor on the first line of the first line of VI N filename: Open the file and place the cursor in the Nth-line head VI FileName: Open the file, and Place the cursor in the last line of VI / PATTERN FileName: Open the file, and place the cursor in the first string of the first one with pattern VI -R FileName: The system crashes when you are using VI editing, restore FileName Vi Filename .... filename: Open multiple files, in turn, edit mobile cursor class command [/ b] h: Cursor left shift a character L: Cursor right shift a character Space: Cursor right shift a character backspace: Cursor left shift one Character K or Ctrl P: The cursor is moved on a row J or Ctrl N: The cursor moves down the entry ENTER: the cursor moves one line W or W: cursor right shifted one word to the first B or B: Cursor left shift one word to word First e or E: cursor right shift one word to the word tail): The cursor moves to the end of the sentence (: the cursor moves to the sentence): The cursor is moved to the beginning of the paragraph {: The cursor is moved to the end of the end NG: cursor to Nth N : Cursor minus N row n-line N-line N row N line N $: cursor to the NT row h: cursor moved to the screen Top M: cursor moved to the screen L: cursor moved to the screen last line 0 :( Note is a number zero) cursor moved to the current list $: cursor moved to the current row screen roll roll class command Ctrl u: Focus half-screen Ctrl D: Tailing the file half screen Ctrl f: File tail turning screen CTRL B; to the file first screen NZ: Rolling the nth row to the top of the screen, not specifying N, roll the current row 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 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 N 1, N2, indicating the input of the entire file as a Command: r! Command: Place the output of command Command to the current row register operation "? NYY: Save the current line and its N r line 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-102792.html

New Post(0)