VI shortcut key "turn" "Weber finishing must be out of the boutique"

Source: Internet
Author: User

  1. The movement of the cursor
    The command cursor moves h or^H Move one character to the left J or^j or ^N Move down one line K or^p Move up one line L or space to the right move a character G move to the last line of the file NG  Move to row N of the file W moves to the beginning of the next word W moves to the beginning of the next word, ignoring punctuation B moves to the beginning of the previous word                        B moves to the beginning of the previous word, ignoring the punctuation L moves to the last line of the screen M moves to the middle line of the screen H                        Move to the first line of the screen e moves to the end of the next word, E moves to the end of the next word, ignoring punctuation ( Move to the beginning of a sentence move to the end of the sentence {move to the beginning of the paragraph} to the beginning of the next paragraph 0 or|move to the first column of the current row n|move to nth column of the current row^move to the first non-null character of the current line moves to the last character of the current line+or return moves to the first character of the next line-Move to the first non-empty character of the previous line
  2. Add text in VI
    Command                         Insert action A after the cursor insert text A in the current line Insert text I insert text before the cursor i insert text before the current line O insert a new row below the current line o insert a                        new row at the top of the current line: R The                  file reads in the files ' contents and inserts them into the current line: NR file                 reads into the files ' contents, and inserts the nth row                   after escapeChar                  
  3.   delete text in VI
      command delete action x Delete the character at the cursor, plus the number of characters you want to delete in front of x NX removes n words from the current cursor Character X to delete the characters before the cursor, you can add the number of characters you want to delete before X. NX deletes the n characters from the current cursor. DW Delete to Next                      The beginning of a word NDW delete n characters from the current cursor DG delete line until end of file dd delete entire row ndd                    Delete db from current line delete the word NDB before the cursor deletes the n word from the current line: N,MD Delete n rows from the beginning of line D or d$ from the cursor to the end of the line Dcursor_command Delete to the cursor command, such as DG will be removed from when the production line to the end of the file  ^h or backspace is inserted, delete the preceding character  ^w insert, delete the preceding word 
  4. Modify VI Text
    The number preceding each command indicates the number of times the command has been repeated command                         substitution operation Rchar                    Replace the current character with Char R text escape            replaces the current character with text until the ESC key is replaced Stext escape             Use text instead of the current character s or Cctext escape         with text instead of the entire line Cwtext escape change the            current word to Text Ctext escape             to change the remainder of the current line to text CG escape                
  5. Find and Replace in VI
    command Lookup and replace operations/text finds text forward in the file?text searches backwards in the file n in the same direction repeatedly finds N in the opposite direction repeatedly finds Ftext Finds text Ftext forward in the current line, looks backwards in the current line, finds text Ttext in the current line, and positions the cursor in the first character of text Ttext finds text backward in the current line and positions the cursor in the first character of text:SetIC Lookup ignores case:SetNoic is case sensitive when looking for: s/oldtext/NewText replace Oldtext:m,ns with NewText/oldtext/NewText in M line through N, replace with NewText OldText&repeat the last: s command: G/text1/s/text2/Text3 Find rows that contain Text1, replace them with Text3 text2:g/text/command to run commands on all lines that contain text: v/text/command command to run on all lines that do not contain text
  6. Copy text in VI

      command copy operation YY puts the contents of the current line into a temporary Buffer Nyy the contents of n rows into a temporary buffer p places the text in the temporary buffer into the cursor after P places the text in the temporary buffer into the light Pre-DSFSD   "  (A-Z) NYY copy n rows into a named buffer with parentheses in the name , omit n to indicate the current line    (A-Z) ndd delete n rows put in a name in parentheses A named buffer, omitting n means the current line    (A-Z) p to enclose the name as a circle The contents of the named buffer of the number are placed in the current line after the    (A-Z) P names a circle The contents of the parentheses of the named buffer are placed before the current line  
  7. Undo and Redo in VI
                             the command undo action U                        undoes the last modification U                        undoes all modifications of the current line.                        Repeats the last modification,                        repeating the previous F, F, t, or T lookup commands in the opposite direction                        ; " NP                       n                        repeat the preceding/or?  Find command N                        repeat in the opposite direction the previous
  8. Save text and Exit VI
    Command                         save and/ or exit Operation: W                       Save the file but do not exit vi:w. File                  to save the modification in file but do not exit VI:WQ or ZZ or: x              Save the file and exit Vi:q!                       Do not save the file, Exit Vi:e!                      
  9. options in  vi  
      option action:  set   All print all options:  set   nooption turn option option off:  set   Nu Print line number before each line:  set   Showmode display is input mode or Replace mode:  set   Noic case is ignored when searching: set  list shows tabs (^i) and end-of-line symbols:  set  ts=8   set tab for text input stops: set  window=n Set the text window to display n rows 
  10. Status of VI
    option                         effect:. =                       Print the line number of the current line:=                       ^g Displays the file                       name, the current line number, the total number of rows in the file, and the percentage of the file location: L                       Use the letter "L "
  11. Positioning paragraphs and placement marks in text
    option                         Action {                        Insert {In first column to define a paragraph [[                       return to beginning of paragraph]]                       move forward to the beginning of the next paragraph m (a-z)                   '  (A-Z)                   moves the cursor to the specified marker, such as '
  12. Connecting Rows in VI
    Option                         Action J                        connects the next line to the end of the current line NJ                       
  13. Cursor Placement and screen adjustment
    option Action H moves the cursor to the top row of the screen NH moves the cursor to the nth row of M below the top row of the screen Move the cursor to the middle of the screen L move the cursor to the bottom line of the screen NL moves the cursor to line n on the bottom line of the screen^e (Ctrl +e) Roll the screen up one line^y Roll the screen down one line^u Roll the screen up half a page^d Roll the screen down half a page^B Roll the screen up one page^f Roll the screen down one page^l Redraw Screen Z-returnset the current row to the top row of the screen NZ-returnPlace the nth row below the current row as the top row Z of the screen.                      Place the current row as the central NZ for the screen. Place the nth row on the current line as the center Z of the screen-Place the current row as the bottom line of the screen NZ-Place the nth row on the current line as the bottom row of the screen
  14.  vi
     Span style= "color: #000000;" > option action: !command executes command commands for the shell, such as:! ls: !!  Execute the previous shell command: R !command Read the command command input and insert, such as: R!
         
          ls executes the LS and reads the contents: W !command the currently edited file as the standard input for the command command and executes the command commands, such as: w! 
          grep all:cd directory changes the current working directory to the directory represented by directory: SH will start a sub s Hell, use  ^d (ctrl+
          d) to return Vi:so file to read and execute commands in the Shell program file  
         
  15.   Macros and abbreviations in VI  

    (Avoid using control keys and symbols, do not use the characters K, V, G, Q, V, *, =, and function keys)

      option Role: Map key COMMAND_SEQ defines a key to run command_seq, such as: Map e ea, whenever you can move E to the end of a word to append text: Map in the status line shows all the fixed Semantic macros: Umap key deletes the macro for the key: AB string1 string2 defines an abbreviation that replaces string2 with string1 when inserting string1. When you want to insert text, type string1 and press ESC, the system inserts STRING2:AB to display all abbreviations: una  string to cancel the abbreviation for string 
  16. Indent text in VI
    Options                          ^i (Ctrl +i) or          tab insert text, insert moving width, moving width is predefined:set  ai                  turns on auto indent:set sw=n                set move width to n characters n<<                       make n rows move left one width n>>                      

VI shortcut key "turn" "Weber finishing must be out of the boutique"

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.