[Linux] vi, vim

vi, vim three mode conversion

three modes

Shortcuts for vi and vim

  1. Copy the current line yy, copy the five lines below the current line 5yy, and paste p (in normal mode)
  2. Delete the current line dd, delete the 5 lines below the current line 5dd. (In normal mode)
  3. Find a word in the file: :/关键字, Enter to find, enter n to find the next (in command line mode).
  4. Set file line number: :set number; Cancel file line number :set nonu. (in command line mode)
  5. The last line Gof text, the first line of text gg. (in normal mode)
  6. In edit mode, enter a string to undo. First, ESC exits the editing mode and becomes the normal mode. Press uit to cancel.
  7. Quickly locate the line number: in normal mode, enter 行号 shift+gto quickly locate the specified line

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324827075&siteId=291194637