Vim practical instruction

 Linux is generally installed by default vim, formerly known as visual interface IMproved, is vian upgraded version.

# Command structure of FIG.

8646214-d2b4f1449befd93a.png
vim command structure of FIG.
8646214-839f7278bc97e3d9.png
FIG keyboard command

# Several practical instruction

(1) command mode
  • Delete actions
  • x Delete current character
  • nxDelete downward ncharacters
  • dd Delete cursor line
  • nddDelete down nthe line
  • d1G Remove the cursor line data up to the first row
  • dG Delete the line the cursor down to the last line of data

  • Jump action
  • gg Jump to the first line of text
  • nG Jump linen
  • G Skip to the bottom of the file
  • n+Jump down nthe line
  • n-Improved recoil nline
  • shift 4 End of the line under the cursor
  • shift 6 Cursor jumps to the first line

  • Copy and revocation
  • yy / nyyCopy the line cursor, plus nexpress copy down nthe line
  • y^ Assignment cursor to the first line of content
  • y$ SUMMARY assignment cursor to the end
  • p After copying the contents of the cursor
  • P Copy the contents before cursor
  • u A revocation operation, restoring a state before
  • U Undo the current line all operations

  • Search matches
  • /vpserDown search vpserstring
  • ?vpserUp search vpserstring
  • n Search down before a search operation
  • N Search up before a search operation

  • Move the cursor
  • 上下左右 up down left right
  • h left
  • j under
  • k on
  • l right

(2) Input (edit) mode
  • i / I At the cursor from lowercase input, capital input from the start line where the first non-space office
  • a / A Start typing a lowercase character from the cursor, the cursor line from the capital last character input
  • o / O Lowercase new line of input lines from the cursor line, next line from the cursor uppercase input newline
  • insert Switch the cursor to an input / replace mode
  • Esc Exit input mode, switch to command mode

(3) the bottom line of command mode

Input mode, press the Escexit to command mode, then enter :to enter command mode the bottom line

  • :w Storage
  • :w! Forced to save
  • :wq Save and exit
  • :q! Give up Logout

  • Set the line number
  • :set nu Show Line Numbers
  • :set nonu Cancel Display line numbers

Reproduced in: https: //www.jianshu.com/p/8029e26a7d36

Guess you like

Origin blog.csdn.net/weixin_33724046/article/details/91322627