Use git user.name and user.email as login and email
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
" ::: :::::::: "
|
||||
" stdheader.vim :+: :+: :+: "
|
||||
" +:+ +:+ +:+ "
|
||||
" By: <gbaconni@student.42lausanne.ch> +#+ +:+ +#+ "
|
||||
" By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ "
|
||||
" +#+#+#+#+#+ +#+ "
|
||||
" Created: 2013/06/15 12:45:56 by zaz #+# #+# "
|
||||
" Updated: 2021/10/25 09:58:04 by gbaconni ### ########.fr "
|
||||
" Updated: 2021/10/26 08:32:41 by gbaconni ### lausanne.ch "
|
||||
" "
|
||||
" **************************************************************************** "
|
||||
|
||||
@@ -61,17 +61,23 @@ let s:marginlen = 5
|
||||
let s:contentlen = s:linelen - (3 * s:marginlen - 1) - strlen(s:asciiart[0])
|
||||
|
||||
function! s:trimlogin ()
|
||||
let l:trimlogin = strpart($USER, 0, 9)
|
||||
let l:trimlogin = strpart(systemlist('git config user.name')[0], 0, 9)
|
||||
if v:shell_error != 0 || strlen(l:trimlogin) == 0
|
||||
let l:trimlogin = strpart($USER, 0, 9)
|
||||
endif
|
||||
if strlen(l:trimlogin) == 0
|
||||
let l:trimlogin = "rfederer"
|
||||
let l:trimlogin = "marvin"
|
||||
endif
|
||||
return l:trimlogin
|
||||
endfunction
|
||||
|
||||
function! s:trimemail ()
|
||||
let l:trimemail = strpart($MAIL, 0, s:contentlen - 16)
|
||||
let l:trimemail = strpart(systemlist('git config user.email')[0], 0, s:contentlen - 5)
|
||||
if v:shell_error != 0 || strlen(l:trimemail) == 0
|
||||
let l:trimemail = strpart($MAIL, 0, s:contentlen - 5)
|
||||
endif
|
||||
if strlen(l:trimemail) == 0
|
||||
let l:trimemail = "rfederer@student.42lausanne.ch"
|
||||
let l:trimemail = "marvin@student.42lausanne.ch"
|
||||
endif
|
||||
return l:trimemail
|
||||
endfunction
|
||||
@@ -118,7 +124,7 @@ function! s:logo2 ()
|
||||
endfunction
|
||||
|
||||
function! s:coderline ()
|
||||
let l:contentline = "By: ". s:trimlogin () . ' <' . s:trimemail () . '>'
|
||||
let l:contentline = "By: ". s:trimemail ()
|
||||
return s:left() . l:contentline . repeat(' ', s:contentlen - strlen(l:contentline)) . s:midgap() . s:asciiart[3] . s:right()
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user