Linux VI Editor

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.