Vim Edit operation

Source: Internet
Author: User

Vim

Insert mode
A after the cursor
End of A Line
o The next line in the row where the cursor
O a row on the line where the cursor is
I before the cursor
I beginning
s delete the character at the cursor position and enter insert mode

Command mode
D Delete
DD Delete When moving forward
DGG delete cursor to top of document
DG Delete cursor to document trailer
d$ Delete the cursor to the end of the line, including the cursor position character
d^ Delete the cursor to the beginning of the line, excluding the character at the cursor position
DW Delete by word
GG jumps to the beginning of the document header
G jumps to the beginning of the document's tail
U undo the previous action
Ctrl+r Redo
Line number g jumps to the specified line
X Delete the contents of the cursor location

Number of lines YY copy cursor line start first line
P Paste to the next line in the row where the cursor is located
CC Cut When moving forward
Row CC cuts the lines starting at the current line
H jumps to the top row of the current screen output
L jump to the bottom line of the current screen output
M jumps to the middle line of the current screen output
$ End of line
^ Beginning of the line
W move the cursor by word
R replaces the character that the cursor contains
H move the cursor to the left by character
J Move cursor down (rear) by line
K Move the cursor up (front) by line
L MOVE the cursor to the right by character

Last-line mode
: W Save
: w filename saved as filename
: Q exit
: Wq Save Exit
: q! Force quit does not save
: Set NU Displays line number
: R/filename reads the contents of the specified file to the current file
: line number jumps to the specified line
: Set Nonu suppress line numbers
:%s/replaced content/replaced content/g (g = global substitution)
:%s/Content
/Find String
N
N
: Noh Suppress highlighting

Vim Edit operation

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.