Vim's editor

Source: Internet
Author: User

Use of the editor:
ESC Command mode
A insert mode (rear insert)
I insert mode (front insert)
o Open a new line below the current line and enter insert mode
O open a new line above the current line and enter insert mode
: Edit mode
V Visual mode

Command mode:
K Move Cursor up
J Move Cursor Down
H move the cursor to the left
L Move Cursor Right
$ cursor moves to end of line
B cursor moves to the beginning of the line
GG cursor moves to the beginning of the content (first line)
G cursor moves to the last line

W cursor moves to the first character of the next word
b The cursor moves to the first character of the previous word

R replacement Mode (replaces one character)
R replaces n characters

X Delete one character
NX removes n characters n-integer

YY Copy a row
NYY Copy N rows
P paste below the current line
P paste to the top of the current line


DD Delete (cut) a row
NDD Delete (cut) n rows


Edit mode:
:/search Searching for search contents
N Find Next
N Find Previous

:%s/search/replace/g Full Text replacement
: n1,n2s/search/replace/g Specifies the number of rows to replace

: W Save
: w filename saved as filename
: Wq Save Exit
: Q Do not save exit


In the visual mode:
Aaaaaaaaaaaaa
Aaaaaaaaaaaaa
Aaaaaaaaaaaaa
Aaaaaaaaaaaaa
Aaaaaaaaaaaaa

Vim's editor

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.