linediff.vim : Perform an interactive diff on two blocks of text
script karma |
Rating 360/128,
Downloaded by 3563 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Andrew Radev |
|
script type |
utility |
|
description |
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.
|
|
install details |
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. |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 142.132.191.50
|