Vim copy operation

Source: Internet
Author: User

1, display line number: Setnumber

2, cancel the line number; Setnonumber

3, in normal mode (press ESC to enter) The key v into the visual mode, and then press the keyboard or h,l key to achieve the text selection.
Other Related commands:
V: Select by character. Often use the pattern, so try it out for yourself.

V: Select by row. This is especially useful when you want to copy or move a lot of lines of text.

CTRL + V: SELECT by block. Very powerful, only in a few editors have such a function. You can select a rectangular block, and the text inside the rectangle will be highlighted.

It is important to note that if you use auto-wrap in vim, VIM will treat your previous input as a row instead of several lines you see, until you press ENTER, and then select the block by the line in Vim when you press block.

Use the arrow keys and commands (motion) described above when selecting the mode. For example, VWWW will highlight the three words in front of the cursor. VJJ will highlight the current row and the following two lines.

4, y copy, p paste

Vim copy operation

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.