Vim Copy & cut

Source: Internet
Author: User

Original: http://vim.wikia.com/wiki/Copy,_cut_and_paste

Reference: http://linuxtoy.org/archives/efficient-editing-with-vim.html

Ever try to cut (or copy) some lines and paste to another place? If you need to count the lines first, then try these to eliminate counting task.

Cut and paste:

  1. Position the cursor where you want to begin cutting.
  2. Press V (or upper case v if you want to cut whole lines ).
  3. Move the cursor to the end of what you want to cut.
  4. Press D.
  5. Move to where you wowould like to paste.
  6. Press P to paste after the cursor, or P to paste before.

Copy and paste can be saved Med with the same steps, only pressing y instead of D in Step 4.

The name of the mark used is related to the Operation (D: delete or Y: Yank ).

I found that those mark names requires minimal movement of my finger.

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.