From 794c21484d7e5d18d83e2bbce825e617d415ab90 Mon Sep 17 00:00:00 2001 From: Michael Geddes Date: Fri, 18 Jun 2010 10:57:35 +0800 Subject: [PATCH] Expose config settings and user signature. Adds config() and user() to the fugitive#buffer() interface. Signed-off-by: Michael Geddes --- plugin/fugitive.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index e34af76..e4a6436 100644 --- 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: