Architects develop--26.VI/VIM related operations

Source: Internet
Author: User
Tags exit in

Vi/vim
Command mode
Insert Mode AIO
Edit mode:

AIO is the insertion mode of Vi/vim.
Command function
A append text after the cursor
A at the end of the bank additional text
I insert text at the cursor money
I start inserting text at the bank
o Inserting rows under the cursor
O INSERT INTO the cursor

Position command
Set number sets line numbers (set Nu)
Set Nonu Cancel line number
If you want to choose to jump to the specified line. Go directly to edit mode and enter line number

Command function
H, left ARROW key to move one character
J, the direction of the next key move down one line
K, move the key up one line above the direction
L, right-click one character to the right
$ move to end of line
0 move to end of line
H Move to upper screen
M move to the center of the screen
L move to the bottom of the screen

Command mode Delete, copy, Paste command

Command function
X Delete the character at cursor location
NX removes the n characters after the cursor is located
DD Delete cursor on, ndd delete n rows
DG deletes the contents of the line to the end of the cursor
D Delete the label at the end of the line
: n1,n2d deletes a specified range of rows
yy, Y Copy as Forward
Nyy, NY Copy the current row under N rows
DD Cut when moving forward
NDD cuts n rows under the current row
P, p pasted under the current cursor row or line

Replace, Search command

Command function
R replaces the character at which the cursor is located
R replaces the character at the beginning of the cursor and presses ESC to end
U Cancel the previous action

Command function
/string searches forward for the specified string, and the search is case-insensitive: Set IC
n searches for the next occurrence of the specified string
:%s/old/new/g full text Replace specified string
: N1,n2s/old/new/g returns the specified string in the specified range

ZZ can also exit in edit mode

Architects develop--26.vi/vim related actions

Related Article

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.