diff --git a/README.md b/README.md index e8f2325..b9f5354 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ It's __fast__, __highly configurable__ and __well documented__. Features: -- supports git, mercurial, darcs, bazaar, subversion, cvs, rcs, fossil +- supports git, mercurial, darcs, bazaar, subversion, cvs, rcs, fossil, accurev, + perforce - quick jumping between blocks of changed lines - apart from signs there is also optional line highlighting - fully configurable through global variables (options and mappings) @@ -102,6 +103,7 @@ Currently the following VCS are supported: - rcs - fossil - accurev +- perforce #### quick jumping between changed lines diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index d433971..e545b2c 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -26,7 +26,7 @@ endif " Function: #detect {{{1 function! sy#repo#detect(path) abort - for type in get(g:, 'signify_vcs_list', [ 'git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', 'accurev' ]) + for type in get(g:, 'signify_vcs_list', [ 'git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', 'accurev', 'perforce' ]) let diff = sy#repo#get_diff_{type}(a:path) if !empty(diff) return [ diff, type ] @@ -139,6 +139,14 @@ function! sy#repo#get_diff_accurev(path) abort endif endfunction +" Function: #get_diff_perforce {{{1 +function! sy#repo#get_diff_perforce(path) abort + if executable('perforce') + let diff = system('env P4DIFF=diff p4 diff -dU0 -- '. sy#util#escape(a:path)) + return v:shell_error ? '' : diff + endif +endfunction + " Function: #process_diff {{{1 function! sy#repo#process_diff(path, diff) abort " Determine where we have to put our signs. diff --git a/doc/signify.txt b/doc/signify.txt index 723e820..5d69951 100644 --- a/doc/signify.txt +++ b/doc/signify.txt @@ -93,7 +93,8 @@ default values, as long as no "Default:" section is given. let g:signify_vcs_list = [ 'git', 'hg' ] -Default: ['git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', 'accurev'] +Default: ['git', 'hg', 'svn', 'darcs', 'bzr', 'fossil', 'cvs', 'rcs', +'accurev', 'perforce'] This variable determines the VCS to check for and in what order. If you only use git and mercurial, you can shorten the list to the shown example. If you