VIM series: basic and common command list

Source: Internet
Author: User
VIM uses the series: basic and common command list to enter the vim command vimfilename: open or create a file, and place the cursor in the first line of vim + nfilename: open the file, place the cursor at the beginning of line n vim + filename: open the file, and place the cursor at the last... VIM uses the series: basic and common command list to enter the vim command vim filename: open or create a file, and place the cursor in the first line of vim + n filename: open the file, place the cursor at the beginning of line n vim + filename: open the file, and place the cursor at the beginning of line n vim +/pattern filename: open the file, place the cursor in the first pattern matching string vim-r filename: the system crashes when the last time vi is being edited, restoring filenamevim filename .... filename: open multiple files, edit the move cursor command in sequence h: Move the cursor one character left l: Move the cursor one character sp Ace: Move the cursor one character to the right Backspace: move the cursor one character to the left k or Ctrl + p: Move the cursor up one line j or Ctrl + n: Move the cursor down one line Enter: Move the cursor down one line w or W: move a word to the right of the cursor to B or B: move a word to the left of the cursor to e or E: move a word to the right of the cursor j to the end of the word): Move the cursor to the end of the sentence (: Move the cursor to the beginning of the sentence }: move the cursor to the beginning of the paragraph {: Move the cursor to the end of the paragraph nG: Move the cursor to the first n rows n +: Move the cursor down n rows n-: Move the cursor up n rows n $: move the cursor to the end of line n H: Move the cursor to the top line of the screen M: Move the cursor to the middle line of the screen L: Move the cursor to the last line of the screen 0 :( Note: number 0) move the cursor to the beginning of the current line $: move the cursor to the end of the current line. run the "Ctrl + u" command to flip the half screen to the beginning of the file. Ctrl + d: Flip the half screen to the end of the file. Ctrl + f: press Ctrl + B to the end of the file, and press nz to the beginning of the file to roll line n to the top of the screen, if n is not specified, roll the current line to the top of the screen and insert the text class command I: before the cursor I: At the beginning of the current line a: After the cursor A: at the end of the current line o: open a new line of O under the current row: Open a new line above the current line r: replace the current character R: replace the current character and the character behind it until press ESC key s: start from the current cursor position, replace the specified number of characters with the input text S: delete the specified number of rows, and replace ncw with the input text or nCW: modify the specified number of characters nCC: run the "ndw" or "ndW" command to delete a specified number of rows: delete the n-1 words "do" at the beginning and end of the cursor to the beginning of the line d $: delete to the end of the line ndd: delete the current row and its n-1 rows x or X: Delete a character, x delete the cursor, and X delete the Ctrl + u before the cursor: delete the text search and replacement command entered in the input mode/pattern: Search for pattern from the beginning of the cursor to the end of the file? Pattern: Search for patternn from the beginning of the cursor. patternn: Repeat the previous search command N in the same direction. N: Repeat the previous search command in the opposite direction. s/p1/p2/g: replace all p1 in the current row with p2: n1, n2s/p1/p2/g: Replace all p1 in line n1 to n2 with p2: % s/p1/p2/g: set all p1 in the file with the p2 replacement option all: list all options settings condition term: set terminal type ignorance: ignore case list in search: show the tab (Ctrl + I) and the line tail sign ($) number: Display the row number report: display the number of lines modified by the line-oriented command terse: Display the brief warning information warn: when you go to another file, if the current file is not saved, NO write information is displayed. nomagic: Allows you to use the special character nowrapscan without "\" in search mode: prohibit vi from accessing the two ends of the file and start mesg from the other end: allow vi to display information written to its terminal by other users using write other commands: N1, n2 co n3: copy the content from line n1 to line n2 to line n3: n1, n2 m n3: move the content from line n1 to line n2 to line n3: n1, line n2 d: delete the content from line n1 to line n2: w: save the current file: e filename: open file filename and edit: x: save the current file and exit: q: Exit vi: q!: Do not save the file and exit vi :! Command: execute shell command: n1, n2 w! Command: The content from line n1 to line n2 in the file is used as the command input and executed. if n1 and n2 are not specified, the entire file content is used as the command input: r! Command: place the output result of the command to the current line.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.