Vim Advanced Skills-use Vim to compare two files

Source: Internet
Author: User

Original article: http://hi.baidu.com/flost_li/blog/item/acbccd2355952d47935807d0.html


Usage:

1: Use vim-D file1 file2 to directly open two files for comparison
Or: Use Vim file1 to open the first file, and then use vert diffsplit file2 to open the second file for comparison;
(VERT indicates the Vertical Split Window, which is a horizontal split window by default)
2: directly compare the differences between the two files: Input in two windows using diffthis;
3: Other tips:
3.1: identify differences: [C,] C jump to the previous and later differences respectively;
3.2: Window jump: Ctrl-w jump to the next window
CTRL-w h/l jump to the left (right) window
CTRL-w j/K jump to the upper (lower) window
3.3: Document merging: DP combines the current document content of the difference points into another document (diff put)
Do copies the content of another document from the difference to the current document.
3.4: open the file fold: (by default, some content is collapsed to expand the field of view)
Zo temporarily expands the same collapsed content
ZC re-fold
# End

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.