Vim basic commands

Source: Internet
Author: User
CTRL + F The screen moves one page down, which is equivalent to the page down button.
CTRL + B The screen moves one page up, which is equivalent to the page up button.
0 or function key home Number "0", move to the top character of this line
$ Or function key end Move to the end of the line
G Move to the last row of the file
Gg Move to the first line of this file
N <enter> N is a number, and the cursor moves down n rows
/Word Search for a string named word under the cursor
? Word Search for a word string above the cursor
: N1, N2s/word1/word2/g N1 and N2 are numbers. In line N1 and N2, find the word1 string and replace it with word2.
: 1, $ S/word1/word2/g Search for the word1 string between 1st and the last line and replace it with word2.
P
Paste copied content
X, X In a line of text, X is to delete a character "Del" from the back, and X is to delete a character from the forward
NDD N is a number, and the cursor deletes n rows down
Nyy N is a number, and the cursor copies n rows down
U Restore the previous action
CTRL + R Redo the previous action


: Set nu Show row number
: Set Nonu Opposite to set Nu, the row number is canceled.


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.