Vim Cross-File replication

Source: Internet
Author: User


We all know that when we copy and paste between a file, Vim provides us with a lot of methods, three modes have a method to achieve the characters, sentences, paragraphs between the copy and paste. At that time, if
We want to copy and paste between two files, which is a bit of a hassle. The way I used to do this was to implement it in a window. The disadvantage of this is that each time you open a file. What's more, if there are too many differences between the two files > directories, it is very troublesome to open them. Furthermore, this method is not suitable for manipulating articles that require root permissions. There is the use of Ctrl+shift+c and ctrl+shift+c to copy and paste operation >. The drawbacks of this approach are even clearer because there are problems with formatting indentation.
Today I saw a method on the Internet, although this method is very troublesome to operate. However, it should be better than the two methods above. First look at the implementation method. This method I just in Ubuntu under the terminal > Operation success, as for the window on the Gvim do not know
1. Ensure that Vim-gnome is installed on your computer. If you do not have the installation, you execute the gvim command and you will be prompted with several Vim-related software that you may need. You directly use

sudo Install Vim-gnome


It's all right.
2. Then we can copy and paste the following command

" +y ( click "->+->y)- copy "+d (Point to->+->y)-copy


The above two are in the mode. If it is in normal mode, then use "+yy".

" +p ( click "->+->y)-Copy


In fact, this command and our YY p and so on as a copy of the file is very similar. If we take the "+" as a choice register it is better to understand. YY is using the default register, and this is > using the + register. The selection of registers is followed by the function operation, so, we are in the file operation, can also be used on the "+", but the front of a register just added. + This register, sense > Sleep should be the system register

Vim Cross-File replication

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.