Linuxvi move cursor command

Source: Internet
Author: User
Linuxvi move cursor command move cursor above: knk: Move n rows up 9999k or gg can move to the first line G move to the last line: jnj: Move n rows down left: hnh: move n columns to Left Right: lnl: Move n columns to right w: Move cursor forward with word nw: Move cursor forward n words...
Linux vi move cursor command move cursor above: k nk: Move n rows up 9999k or gg can move to the first line G move to the last line: j nj: Move n rows down left: h nh: Move n columns to the left right: l nl: Move n columns to the right w: Move the cursor forward with words nw: move the cursor n words forward to the first letter of the word B: w opposite e: Move the cursor forward with the word ne: cursor move n words forward cursor to last letter of word ge: opposite to e $: Move cursor to end n $: move to end 0 (Num) of line n): Move the cursor to the beginning of the line ^: Move the cursor to the first non-empty character in the line f: Move the cursor to character a of the current line, nf move the cursor to the nth a character of the current row F: opposite www.2cto.com %: move to the matching brackets (), {}, [], <>, and so on. NG: Move to line n G: CTRL + G to the last line to get the position of the current cursor in the file forward flip: CTRL + F move down half screen: CTRL + G flip back: CTRL + B storage: q!: Do not save disk exit: e!: Abandon modifying file content, re-load this file edit: wq: Save disk exit dw: Delete a word, move the cursor to the first letter of the word, Press dw, if the cursor is at any position of a word, use dawdnw: to delete n words dne: or, just delete to the end of the word dnl: To the right to delete n letters dnh: delete n letters to the left dnj: delete n rows dnk: delete n rows d $: delete the letter dd from the current cursor to the end of the row to be changed: delete a line www.2cto.com cnw [word]: Change n words to wordcc: change the entire line C $: change to the end of the line J: delete the line break, move the cursor to the change line, press shift + j to delete the line break at the end of the line. The next line is connected. u: undo the previous operation shif + u (U): undo all operations on this row.: Set showmode: set the display mode o: start another line O (shift + o) below the current row: start another line nk or nj above the current row: the cursor moves n rows up or down, and n is a number! [ESC]: add n exclamation points (!) to the end of the row (!) Nx: execute n x (delete) operations ZZ: save the current document and exit VIM: help: view the help document. in this case, press CTRL +] to enter the hyper-connection, press CTRL + O to return.: Help subject: view the help of a topic. ZZ exits the help www.2cto.com: set number/set nonumber: show/do not show the row number: set rlimit/set northeast: show/do not show the ruler/pattern? Search for a character pattern in the reverse direction of pattern and press n to continue looking down, place the cursor over a word, and then press the X key to search for the word :/\ : Set hlsearch highlight the searched words: set nohlsearch turn off the function m [a-z]: Mark in the text, the mark number can be 26 letters of a-z, you can use 'a to move to Mark a. r: replace the current character nr: replace the current n characters to find and replace: way1:/[word]: Find a wordcw [newword ]: replace with new wordn: continue searching.: replace way2: s/string1/string2/g: replace string1 with string2 in a row. g indicates that the execution uses c to confirm: num1, num2 s/string1/string2/g: replace string1 with string2: 1, $ s/string1/string2/g between num1 and num2: replace string1 with string2 v in the full text: enter visual mode [ESC] Exit V: shift + v enter the visual mode of the line CTRL + V: enter the block operation mode To change the size of the selected edge. Www.2cto.com paste: p. copy the text deleted with x or d: ynw: copy n words yy: copy a line ynl: copy n characters y $: copy the current cursor to the end of the row nyy: copy n rows are finished p paste: split a window: split file. c: another file. c-separated window: nsplit file. c: another file. c. separate the window and specify the number of rows CTRL + W. switch to the window: close the current window and insert the same content in all rows, such as include. The operation is as follows: move the cursor to the start insertion position, press CTRL + V to enter the VISUAL mode, select the module, press I (shift + I), and insert the text to be inserted, press [ESC.: Read file. c. file the file. insert the content of c to the current cursor: 0 read file. c. file the file. insert the content of c to the beginning of the current file (row 0th): nread file. c. file the file. insert the content of c to the end of row n of the current file: read! Cmd: Insert the output of the external command cmd to the following position where the current cursor is located: n1, n2 write temp. c. write n1 to n2 in this file into temp. c in this file, go to www.2cto.com CTRL + L to refresh the screen shift + <shift a row left +> right shift a row u: undoCTRL + R: re-doJ: merge a row of CTRL + p to automatically complete the function CTRL + g to view the full path of the current file q [a-z] start record, but the previous operation is macro, the name can be [a-z ], then use q to terminate the recording macro. Use reg to display all macros currently defined, and use @ [a-z] to execute macro [a-z] at the current cursor.
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.