2015.3.25 Vim Editor

Source: Internet
Author: User

1. Install Vim

#vim +n filename # #n是数字, you can navigate to the nth row of the file


2. Shortcut keys

In the general mode:

J down K up H left L right

The number 0 or shift+6 moves to the beginning of the bank

Shift+4 move to the end of bank line

GG move to first line g move to Tail line

NG (n is any number) moves the nth row

In edit mode:

I enter edit mode

Command mode:

/word? Word looks for a string after/before the cursor

: n1,n2s/word1/word2/g find word1 between n1,n2 rows and replace with Word2, and no G replaces only the first word1 of each row

: 1, $s/word1/word2/g replace all word1 in the document with Word2, no G replaces only the first word1 of each row

: Set NU Displays line number: Set Nonu does not display line numbers

This article is from the "Rhythm" blog, make sure to keep this source http://rhythm.blog.51cto.com/2800158/1629239

2015.3.25 Vim 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.