Linux The vi (vim) editor

Command-line mode : The default mode command is coming, many commands may be used: for example, i, a, o

  • i: before the cursor typing
  • a: The next character cursor start typing
  • o: the cursor on the next line start typing

Edit mode : exit edit mode: esc on the keyboard, enter the command line mode

Extended Mode : Press the + shift key of the keyboard: entering the extended mode, enter the exit q

  • q simply quit
  • q! Force Quit
  • w Storage
  • wq to save and exit
  • wq! Force Save and Exit

Common editing shortcuts:

  • Skip to end of shift + g files
  • $ Jumps to the end of this line
  • 0 or shift +6 (^) back to the beginning of the line
  • yy copy cursor line
  • I want to copy line p move the cursor by p
  • nyy replication after the cursor after the n-th row, to duplicate rows
  • dd Delete cursor line
  • ndd Delete n lines after the start of the cursor, delete lines
  • \ At port command line mode search port, the cursor jumps to the line
  • Byte puncturing x   

 

Guess you like

Origin www.cnblogs.com/wuzm/p/10992059.html