commit 794c21484d7e5d18d83e2bbce825e617d415ab90 (tree) parent 7390538db0e5ba75a83794c944e7611a105a323c Author: Michael Geddes <vimmer@frog.wheelycreek.net> Date: Fri, 18 Jun 2010 10:57:35 +0800 Expose config settings and user signature. Adds config() and user() to the fugitive#buffer() interface. Signed-off-by: Michael Geddes <vimmer@frog.wheelycreek.net> Diffstat:
| M | plugin/fugitive.vim | | | 12 | ++++++++++++ |
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -1729,6 +1729,18 @@ function! fugitive#statusline(...) endif endfunction +function! s:repo_config(conf) dict abort + return matchstr(system(s:repo().git_command('config').' '.a:conf),"[^\r\n]*") +endfun + +function! s:repo_user() dict abort + let username=s:repo().config('user.name') + let useremail=s:repo().config('user.email') + return username.' <'.useremail.'>' +endfun + +call s:add_methods('repo',['config', 'user']) + " }}}1 " vim:set ft=vim ts=8 sw=2 sts=2: