Skip to content

vim-scripts/linediff.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a mirror of http://www.vim.org/scripts/script.php?script_id=3745

This plugin provides a simple command, ":Linediff", which is used to diff two separate blocks of text. Here's a simple example:

    def one
      two
    end

    def two
      three
    end

If we mark the first three lines, starting from "def one", in visual mode, and execute the ":Linediff" command, the signs "1-" will be placed at the start and at the end of the visual mode's range. Doing the same thing on the bottom half of the code, starting from "def two", will result in the signs "2-" placed there. After that, a new tab will be opened with the two blocks of code in vertical splits, diffed against each other.

The two buffers are temporary, but when any one of them is saved, its original buffer is updated. Note that this doesn't save the original buffer, just performs the change. Saving is something you should do later on yourself.

Executing the command ":LinediffReset" will delete the temporary buffers and remove the signs. Executing a new ":Linediff" will do the same as ":LinediffReset", but will also initiate a new diff process.

The code is hosted on github, at http://github.com/AndrewRadev/linediff.vim. To report any bugs, send patches or suggest features, please use github's issue tracker: http://github.com/AndrewRadev/linediff.vim/issues.

About

Perform an interactive diff on two blocks of text

Resources

Stars

Watchers

Forks

Packages

No packages published