Vim selected character copy/cut/paste

Source: Internet
Author: User

Reprinted from: http://www.cnblogs.com/luosongchao/p/3193153.html

Problem Description:

Select the specified character in vim to copy/cut/paste

Select:1, Normal mode--v+hjkl to choose.

2, the Visual Line mode button V can enter only to select the row

After pressing V, enter visual line mode and use the J/K key to select one or more rows

3. Visual block mode, press CTRL + V to enter

After pressing CTRL + V, enter the visual block mode and use the J/K/H/L key to select a piece (this time you do not need V).

copy:y.

paste:p.

Problem solving:

into vim in visual mode, visual mode enters, there can be three ways:

(1) In normal mode, the direct key V can enter the default visual mode, you can use v+j/k/h/l for text selection

Note:

Use the v command in normal mode to enter visual mode, v+ j/k/h/l for text selection

Press the following key for the selected text:

(1.1) d------cut operation

(1.2) y-------copy operation

(1.3) p-------paste operation

(1.4) ^--------Select the current row, the cursor position to the beginning of the line (or use the keyboard's home key)

(1.5) $--------Select the current line, the cursor position to the end of the line (or use the end key of the keyboard)

(2) Visual line mode key V can enter

After pressing V, enter visual line mode and use the J/K key to select one or more rows

(3) Visual block mode, press CTRL + V to enter

After pressing CTRL + V, enter visual block mode and use the J/K/H/L key to select a

Note:

In block mode, multiple columns can be modified at the same time, modified by:

First enter block Mode Ctrl + V

Use key j/k/h/l to select multiple columns

Press SHIFT + I to insert in block mode

After entering a character, press ESC to finish inserting multiple lines

Vim selected character copy/cut/paste

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.