diff options
author | Freed-Wu <Wuzy01@qq.com> | 2020-06-04 13:28:32 +0800 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-06-04 08:02:21 +0200 |
commit | 632d0a72c83cd0ccf7f40cb64470dc84f51bdce2 (patch) | |
tree | 80250a5d57b2a902ec0a0a5c7287c44670d7c5de | |
parent | plugin/gentoo-common.vim: Stop suggesting py2 in newebuild (diff) | |
download | gentoo-syntax-632d0a72c83cd0ccf7f40cb64470dc84f51bdce2.tar.gz gentoo-syntax-632d0a72c83cd0ccf7f40cb64470dc84f51bdce2.tar.bz2 gentoo-syntax-632d0a72c83cd0ccf7f40cb64470dc84f51bdce2.zip |
use git config to get email and name of user
Closes: https://github.com/gentoo/gentoo-syntax/pull/29
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | plugin/gentoo-common.vim | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugin/gentoo-common.vim b/plugin/gentoo-common.vim index 65a8691..a0fe9cc 100644 --- a/plugin/gentoo-common.vim +++ b/plugin/gentoo-common.vim @@ -13,10 +13,9 @@ let g:loaded_gentoo_common=1 fun! GentooGetUser() let l:result = expand("\$ECHANGELOG_USER") if l:result ==# "\$ECHANGELOG_USER" - let l:result = expand("\$USER") - endif - if l:result ==# "\$USER" - let l:result = "" + let l:email = system('git config --global user.email') + let l:name = system('git config --global user.name') + let l:result = l:name . ' <' . l:email . '>' endif return l:result endfun @@ -71,4 +70,4 @@ fun! GentooGetPythonTargets() endif endfun -" vim: set et foldmethod=marker : " +" vim: set et foldmethod=marker sw=4 ts=4 : " |