" NB 12.12.22: Functions to comment texts
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+func! CommentMeNow()
+ let user_initials = system('printf "%s" ${USER_INITIALS:-`whoami`}')
+ return $user_initials . ' ' . strftime('%d.%m.%y')
+endfunc
+
func! CommentSubSpecialChar(text)
" NB 12.12.22: Substitute specials char like \n in an array
let i = 0
call CommentSubSpecialChar(comment)
" Beginning of line
- let new_line = comment[0].' '.MeNow().': foo '
+ let new_line = comment[0].' '.CommentMeNow().': foo '
" End of line
if ( len(comment)>1 )
" NB 11.12.22 let v = ''
" NB 11.12.22 let v = ''
" Beginning of line
- let new_line = substitute(curr_line,'^\([\t ]*\)','\1'.comment[0].' '.MeNow().' ','')
+ let new_line = substitute(curr_line,'^\([\t ]*\)','\1'.comment[0].' '.CommentMeNow().' ','')
" End of line
if ( len(comment)>1 )
let new_line = substitute(new_line,'\s*$',' '.comment[1],'')