1 , command-line mode ) function keys
a ). Insert mode
I : Start typing text at the cursor's current position
I : Enter the file at the beginning of the current line
A : Enter text from the next position where the cursor is currently located
A : Enter the file at the end of the current line;
o insert a new line and enter text from the beginning of the beginning.
O : A new line is opened above the current row;
S: replaces the specified number of characters with the input text starting at the current cursor position
S: Deletes the specified number of rows and replaces them with the input text
b ). Move Cursor
VI can be directly on the keyboard with the cursor to move up and down, but the normal vi is the lowercase English letter H J k L, respectively, control the cursor left, bottom, upper and right one grid.
Space cursor moves right one character
Backspace: Cursor moves left one character
Enter : Move the cursor down one line
Ctrl+b: Screen moves to " back " one page
Ctrl+f: Screen to " front " move one page
Ctrl+u: The screen moves half a page toward " rear "
Ctrl+d: Screen moves half page toward " front "
number 0: Move the cursor to the current line
$: Cursor moves to the end of the current line
n$: Cursor moves to end of nth line
GG: Number plus GG means to navigate to the row of numeric rows
Ctrl+g Lists the line number of the line where the cursor is located
^: Move to the line of the cursor where the " beginning of non-empty word prompt "
W: Cursor to the beginning of the next word jump
E: The cursor jumps to the end of the next word
b: The cursor goes back to the beginning of the last word
) : Move the cursor to the beginning of the paragraph
(: Cursor moves to end of paragraph
}: Cursor moves to the beginning of the paragraph
{ : Move the cursor to the end of the paragraph
N+: Cursor down n line (equivalent to n<enter>< Span style= "font-family: ' The song Body '; >)
N-: Move cursor up n line
H : Cursor moves to the middle line of the screen
L : The cursor moves to the last line of the screen
c . delete text
X: Delete one character at the cursor position each time you press it.
X: Uppercase X" : Delete to end of line
D . copy
Yy: Copy the row of the cursor to the buffer.
P: Paste the characters in the buffer to the cursor location
e replace
R : The character at which the cursor is replaced
R: Replace the character where the cursor is, until you press ESC
F ). Redo the last action
U: If you mistakenly execute a command, you can press U immediately togo back to the previous operation. multiple replies can be performed by multiple "U"
2 , last line mode about the next command
a) list line numbers
: Set Nu: line number listed before each line
: Set Nonu: To cancel line number
b) jump to a line in the file
#:# indicates a number, enter a number after the colon, and then press ENTER to jump to that line.
c) Find characters
/ Keyword: If the first keyword is not what you want, you can always press N to find the keyword you want.
? Keywords : If the first keyword is not what you want, you can always press N to look forward to the keyword you want .
Linux VI Editor