Vim Advanced Skills-use vim to compare two files

Source: Internet
Author: User

Vim Advanced Skills-use vim to compare two files: 1: Use vim-d file1 file2 to directly open two files or: Use vim file1 to open the first file, use vert diffsplit file2 to open the second file for comparison. (vert indicates the Vertical Split Window, which is the horizontal split window by default.) 2: directly compare the differences between the two files: use diffthis to input in two windows respectively. 3: Other Tips: 3.1: locate the difference: [c,] c jump to the previous and next 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 top (bottom) window 3.3: Document merging: dp merges the current document content of the difference point into another document (diff put) do to copy the content of another document of the difference point to the current document 3.4: open File collapse: (partial text is collapsed by default to expand the field of view) zo temporarily expands zc duplicates of the same content to be collapsed New folding # end sometimes the disk space is too large, you need to find out which directories are the culprit, and sometimes will be lazy, do not want to check which logs are too large, then you can use the following statement to view: du. /*-s -- time |-s option of sort-g du, which only provides a total statistics for each parameter. The -- time option lists the last modification time of the parameter file. Output them to the sort command, and use the-g option to sort the sort by number, rather than the dictionary order. In this way, the bottom file is the largest file, which can be easily checked. Or # the entire filesystem, starting at '/'du-a/* | sort-n-r | head-n 10 # or for a particle directory: du-a/home/username/| sort-n-r | head-n 10

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.