linediff.vim : Perform an interactive diff on two blocks of text
| script karma
Downloaded by 434
Comments, bugs, improvements
script versions (upload new version)
|This plugin provides a simple command, ":Linediff", which is used to diff two separate blocks of text. Here's a simple example:
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.
|The recommended way to install the plugin is by using Tim Pope's pathogen (http://www.vim.org/scripts/script.php?script_id=2332). In that case, you can clone the plugin's git repository like so:
git clone git://github.com/AndrewRadev/linediff.vim.git ~/.vim/bundle/linediff
If your vim configuration is under git version control, you could also set up the repository as a submodule, which would allow you to update more easily. The command is (provided you're in ~/.vim):
git submodule add git://github.com/AndrewRadev/linediff.vim.git bundle/linediff
Another method of installation is to simply copy all the essential directories inside the ~.vim/ directory: plugin, autoload, doc.
Click on the package to download.
ip used for rating: 22.214.171.124