Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5ce6e12
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This is a mirror of http://www.vim.org/scripts/script.php?script_id=4247 | ||
|
||
Calling :TabDiff will open each pair of buffers in a vertically split tab and in diff mode. Now you can | ||
|
||
vim -c "silent :TabDiff" a A b B c C | ||
|
||
To diff a bunch of files at once in different tabs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Vim TabDiff | ||
## A different way to vimdiff | ||
|
||
Gives you the tabdiff command, which will open all your pairs of buffers in | ||
opposing vertical splits in different tabs. Now you can | ||
|
||
vim -c 'silent :TabDiff' A a B b C c | ||
|
||
And nicely diff all those files at once. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
*tabdiff.txt* Diff in Tabs | ||
|
||
Author: Nate Soares <http://so8r.es/> | ||
License: GPLv2 (http://www.gnu.org/licenses/gpl-2.0.html) | ||
|
||
INTRODUCTION *tabdiff* | ||
|
||
Diff many files in multiple tabs. | ||
|
||
COMMANDS *tabdiff-commands* | ||
|
||
*tabdiff-:TabDiff* | ||
:TabDiff | ||
Creates a new tab page for each consecutive pair of buffers | ||
(split vertically, with the first on the left and the second | ||
on the right) and sets all of the windows to diff mode. The | ||
original tab page is closed. | ||
|
||
Intended usage is to start vim with alternating 'old' and | ||
'new' files and then invoke this function immediately. It | ||
expects there to be only one tab and an even number of | ||
buffers, as in: > | ||
vim -c 'silent :TabDiff' \ | ||
/tmp/original/apples apples \ | ||
/tmp/original/oranges oranges | ||
< | ||
|
||
ABOUT *tabdiff-about* | ||
|
||
Grab the latest version or report a bug on GitHub: | ||
|
||
http://github.com/Soares/butane.vim | ||
|
||
vim:tw=78:ts=8:noet:ft=help:norl: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
" tabdiff.vim A differetn way to diff. | ||
" Author: Laurence Gonsalves <laurence@xenomachia.com> | ||
" Maintainer: Nathaniel Soares <http://so8r.es/> | ||
" Version: 1.0 | ||
" License: GPLv2 <http://www.gnu.org/licenses/gpl-2.0.html> | ||
|
||
if exists("g:loaded_tabdiff") || &cp || v:version < 700 | ||
finish | ||
endif | ||
let g:loaded_tabdiff = 1 | ||
|
||
|
||
" Creates a new tab page for each consecutive pair of buffers (split | ||
" vertically, with first on left and second on right) and sets all of the | ||
" new windows to diff mode. The original tab page will also be closed. | ||
" | ||
" Intended usage is to start vim with alternating "old" and "new" files, | ||
" and then invoke this function. It expects there to be only one tab | ||
" open and 2*n buffers. | ||
" | ||
" Example: | ||
" gvim -c 'silent call TabDiff()' old-foo foo old-bar bar | ||
" | ||
" This will result in two tabs: old-foo+foo diff, and old-bar+bar diff. | ||
function! tabdiff#TabDiff() | ||
let s:tab_multi_diff = 0 | ||
argdo call s:AddBufferToTab() | ||
tabclose | ||
endfun | ||
command! TabDiff call tabdiff#TabDiff() | ||
|
||
|
||
" Helper function used by TabDiff(). Adds current buffer to new tab | ||
" or last tab as appropriate, and sets new window's "diff" option. | ||
function! s:AddBufferToTab() | ||
let buf = bufnr("%") | ||
if s:tab_multi_diff | ||
tablast | ||
vsplit | ||
wincmd w | ||
else | ||
tab split | ||
tabmove | ||
endif | ||
let s:tab_multi_diff = ! s:tab_multi_diff | ||
exe 'b ' . buf | ||
diffthis | ||
tabfirst | ||
endfun |