vim-Common shortcut keys

Source: Internet
Author: User
Tags string find

1. Mobile

$: Move to end of line

0: Move to the beginning of the line

G: Jump to the beginning of the last line

GG: Jumps to the beginning of the first line

+: Move to the beginning of the next line

-(not minus): Moves to the beginning of the previous line

2. Find

/string find String, enter, press N to jump to the next, N Previous. Press the up and down keys to find the previously searched records after pressing the/key again.

3. Add password

":" + "X": Prompts you to enter the password two times. After: Wq save exit. You will be prompted to enter your password when you re-enter. If you do not want the password, it is: X prompts you to enter the password two times in a row to press ENTER, it is done.

4. Copy and paste, delete and revoke

DD: Delete a row

U: Perform one recovery

YY: Copy one line

P: Paste a line

5. Display line Numbers

1. Execution of each open file: Set Nu

2.

Locate the current user's VIMRC file. If you do not have this file, you can create this file.

Vim ~/.VIMRC

After opening the file, add the last

Set Nu

Wq exit.

Open with Vim again to display the line number.

vim-Common shortcut keys

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.