├── NEWS ├── README ├── TODO └── plugin └── scmdiff.vim /NEWS: -------------------------------------------------------------------------------- 1 | 2008-09-20 2 | * Changed the default diff key from C-d to d (default would be \d) 3 | 4 | 2008-09-03 5 | * Add Enabled/Disabled messages when scmdiff is toggled 6 | * Fix highlighting on error messages so subsequent messages aren't highlighted 7 | 8 | 2008-08-25 9 | * Move Highlight colors out of code so they can be customized by user in .vimrc 10 | 11 | 2008-08-18 12 | * Initial support for mercurial auto-detection 13 | 14 | 2008-08-17 15 | * fix bug: Look for SCM directories based on path of file in current buffer, not on getcwd() 16 | 17 | 2008-08-15 18 | * Add auto-detection of svn, git, and cvs SCMs 19 | 20 | 2008-08-10 21 | 22 | * Make C-d a toggle to turn the diff on/off 23 | * Avoid deleting unrelated buffers when turning diff off 24 | * Autorefresh now works properly 25 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | vim-scmdiff: A Vim script to show the differences from a base version in SCM. 3 | 4 | Supported SCMs: 5 | * CVS 6 | * SVN 7 | * GIT 8 | * Mercurial 9 | * Bitkeeper 10 | 11 | Installation: 12 | Copy the scmdiff.vim script to your vim plugin path ie: "~/.vim/plugin". (system paths may vary) 13 | 14 | Default commands: 15 | \d Toggle diff view on/off 16 | :D rev Difference between current and rev 17 | 18 | This script is an evolution from the scripts posted at the following places: 19 | http://tekrat.com/2008/02/21/vim-diff/ 20 | http://www.vim.org/scripts/script.php?script_id=2201 21 | http://playground.audioscrobbler.com/jonty/scmdiff.vim 22 | 23 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Bugs 2 | 3 | * After exiting (:q) a buffer that has diff enabled, subsequent diffs appear to fail. 4 | * Should restore options like 'wrap' to their original state when turning diff off 5 | * winsaveview() and winrestview() require Vim 7.x. Autodetect and degrade gracefully. 6 | 7 | Features 8 | 9 | * Option to show side-by-side diff (ie. don't hide original buffer) 10 | * Make it easier to customize colors and commands 11 | * Add a refresh or enable an auto-update feature so diff highlighting changes as changes are made. 12 | -------------------------------------------------------------------------------- /plugin/scmdiff.vim: -------------------------------------------------------------------------------- 1 | " Vim script to show file differences from a base version in SCM. 2 | " Home: http://github.com/ghewgill/vim-scmdiff 3 | 4 | " Default commands: 5 | " \d Toggle diff view on/off 6 | " :D rev Difference between current and rev 7 | " 8 | " You can change the highlighting by adding the following to your 9 | " .vimrc file and customizing as necessary. (or just uncomment them here): 10 | " highlight DiffAdd ctermbg=DarkBlue ctermfg=white cterm=NONE 11 | " highlight DiffChange ctermbg=DarkBlue ctermfg=white cterm=NONE 12 | " highlight DiffText ctermbg=DarkBlue ctermfg=white cterm=underline 13 | " highlight DiffDelete ctermbg=red ctermfg=white 14 | 15 | if exists("loadedScmDiff") || &cp 16 | finish 17 | endif 18 | 19 | let loadedScmDiff = 1 20 | 21 | map d :call scmToggle() 22 | noremap