Added Perforce plugin.
[profile.git] / .vim / perforce / perforceutils.vim
1 " perforceutils.vim: Add-On utilities for perforce plugin.
2 " Author: Hari Krishna (hari_vim at yahoo dot com)
3 " Last Change: 29-Aug-2006 @ 17:57
4 " Created:     19-Apr-2004
5 " Requires:    Vim-7.0
6 " Version:     1.2.0
7 " Licence: This program is free software; you can redistribute it and/or
8 "          modify it under the terms of the GNU General Public License.
9 "          See http://www.gnu.org/copyleft/gpl.txt 
10 " NOTE:
11 "   - This may not work well if there are multiple diff formats are mixed in
12 "     the same file.
13
14 " Make sure line-continuations won't cause any problem. This will be restored
15 "   at the end
16 let s:save_cpo = &cpo
17 set cpo&vim
18
19 " CAUTION: Don't assume the existence of plugin/perforce.vim (or any other
20 "   plugins) at the time this file is sourced.
21
22 command! -nargs=0 PFDiffLink :call perforceutils#DiffOpenSrc(0)
23 command! -nargs=0 PFDiffPLink :call perforceutils#DiffOpenSrc(1)
24
25 command! PFShowConflicts :call perforceutils#ShowConflicts()
26
27 aug P4DiffLink
28   au!
29   au FileType * :if expand('<amatch>') ==# 'diff' && exists('b:p4OrgFileName') |
30         \   call perforceutils#SetupDiffLink() |
31         \ endif
32 aug END
33  
34
35 " Restore cpo.
36 let &cpo = s:save_cpo
37 unlet s:save_cpo
38
39 " vim6:fdm=marker et sw=2