2009-02-20 23:53:18 +01:00
|
|
|
" ~/.vimrc (configuration file for vim only)
|
|
|
|
" skeletons
|
|
|
|
function! SKEL_spec()
|
|
|
|
0r /usr/share/vim/current/skeletons/skeleton.spec
|
|
|
|
language time en_US
|
2009-09-28 17:26:50 +02:00
|
|
|
if $USER != ''
|
|
|
|
let login = $USER
|
|
|
|
elseif $LOGNAME != ''
|
|
|
|
let login = $LOGNAME
|
2009-02-20 23:53:18 +01:00
|
|
|
else
|
2009-09-28 17:26:50 +02:00
|
|
|
let login = 'unknown'
|
2009-02-20 23:53:18 +01:00
|
|
|
endif
|
2009-09-28 17:26:50 +02:00
|
|
|
let newline = stridx(login, "\n")
|
|
|
|
if newline != -1
|
|
|
|
let login = strpart(login, 0, newline)
|
|
|
|
endif
|
|
|
|
if $HOSTNAME != ''
|
|
|
|
let hostname = $HOSTNAME
|
2009-02-20 23:53:18 +01:00
|
|
|
else
|
2009-09-28 17:26:50 +02:00
|
|
|
let hostname = system('hostname -f')
|
|
|
|
if v:shell_error
|
|
|
|
let hostname = 'localhost'
|
2009-02-20 23:53:18 +01:00
|
|
|
endif
|
|
|
|
endif
|
2009-09-28 17:26:50 +02:00
|
|
|
let newline = stridx(hostname, "\n")
|
|
|
|
if newline != -1
|
|
|
|
let hostname = strpart(hostname, 0, newline)
|
|
|
|
endif
|
2009-02-20 23:53:18 +01:00
|
|
|
exe "%s/specRPM_CREATION_DATE/" . strftime("%a\ %b\ %d\ %Y") . "/ge"
|
|
|
|
exe "%s/specRPM_CREATION_AUTHOR_MAIL/" . login . "@" . hostname . "/ge"
|
|
|
|
exe "%s/specRPM_CREATION_NAME/" . expand("%:t:r") . "/ge"
|
2009-02-26 15:49:59 +01:00
|
|
|
setf spec
|
2009-02-20 23:53:18 +01:00
|
|
|
endfunction
|
|
|
|
autocmd BufNewFile *.spec call SKEL_spec()
|
2009-02-26 15:49:59 +01:00
|
|
|
" filetypes
|
|
|
|
filetype plugin on
|
|
|
|
filetype indent on
|
2009-02-20 23:53:18 +01:00
|
|
|
" ~/.vimrc ends here
|