Use shortcut keys and cursor vi command line

Command line shortcuts
Move the cursor
  • Ctrl - a: to start of line
  • Ctrl - e: Position the cursor on
  • Ctrl - b: back (left) one character
  • Ctrl - f: back (right) one character
  • Alt - b: back (left) to move a word
  • Alt - f: back (Right) move a word
  • Ctrl - xx: move between the command cursor and the end of the line
  • Mb: back (left) to move a word
  • Mf: back (Right) move a word
 
 
Edit command
  • Delete the character left of the cursor position: h - Ctrl
  • Ctrl - d: Delete character right of the cursor position (Note: the current command line without any characters, the system will log off or end terminals)
  • Ctrl - w: starting from the cursor position to the left to delete the word. To the beginning of the line deleted
  • Alt - d: starting from the cursor position, the right to delete words. Delete to end of line
  • M - d: starting from the cursor position, delete the word, until the end of the word.
  • Ctrl - k: starting from the cursor position, deletes all characters to the right, until the end of the line.
  • Ctrl - u: starting from the cursor position, deletes all characters to the left until the start of the line.
  • Ctrl - y: Paste the contents to be deleted before the cursor.
  • ctrl - t: two switching positions and the character before the cursor.
  • Alt +:. The final parameter on the use of a command.
  • Ctrl - _: Reply to state before. Undo.
 
 
ctrl + l (L lowercase) clear the screen
Ctrl + y Ctrl + u, Ctrl + k, Ctrl + w deleted text :: Paste.
Ctrl + p: command on a history of use. (P: previous)
Ctrl + n: a history command used. (N: next)
Ctrl + r: quick retrieval commands. (R: retrieve).
=======================================================
vim cursor shortcut keys used
h or left arrow: Move the cursor to the left one character, together numbers and letters used in conjunction, 5h 5 represents a mobile character to the left, and so the following three primary
j or right arrow: move the cursor down one character
or k arrow: move the cursor up one character
l or lower arrow: move the cursor one character to the right
 
ctrl + f: move the cursor down one
ctrl + b: a cursor up
ctrl+d:光标向下移动半页
ctrl+u:光标向上移动半页
 
n<space> :n表示数字,例如:按10,之后按空格键space,光标会向右移动这一行的10个字符(常用)
0或者home键:光标移动到这一行的最前面(常用)
$或者end键:光标移动到这一行的最后面(常用)
 
G :移动到文件的最后一行(常用)
nG :n表示数字,例如:10G,光标移动到文件的第10行(常用)
gg :光标移动到文件的第一行(常用)
n+回车键  :光标向下移动n行,例,先按10,接下来按回车,光标就会向下移动10行(常用)
:n+回车键 : n代表数字,光标移动到第n行(常用)

Guess you like

Origin www.cnblogs.com/xyz999/p/11716612.html