Summary of common vim commands

Source: Internet
Author: User

Vim is a powerful tool for development in linux. I believe many people feel its strength. As a powerful editor, I use a lot of it, but I am not very proficient in it. Sometimes I forget to check the usage. Below is my summary of the most commonly used, record: Normal Mode: j: Move up 5j move up 5 rows k: Move down 5 k move down 5 rows G: to the last line of the document nG: to the nth line gg: to the first line of the document h: shift left, 5 h, move left 5 characters. L: Shift right, 5l, and 5 characters to the right. 0: Beginning of the line ^: first non-empty character $: the end of the line is ctrl + f: Move down one page ctrl + B: Move up one page command mode: set nu: Show row number: set nonu: Cancel row number/word: Search for word n after the mouse to continue searching for N back looking? Word: Find the word before the mouse replacement: 1, $ s/word1/word2/g: replace word1 with word2: 1, $ s/word1/word2/gc: replace word1 with word2, and each time you need to determine the author singleant

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.