-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
29 lines (29 loc) · 849 Bytes
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
" ~/.vimrc (configuration file for vim only)
" skeletons
function! SKEL_spec()
0r /usr/share/vim/current/skeletons/skeleton.spec
language time en_US
let login = system('whoami')
if v:shell_error
let login = 'unknown'
else
let newline = stridx(login, "\n")
if newline != -1
let login = strpart(login, 0, newline)
endif
endif
let hostname = system('hostname -f')
if v:shell_error
let hostname = 'localhost'
else
let newline = stridx(hostname, "\n")
if newline != -1
let hostname = strpart(hostname, 0, newline)
endif
endif
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"
endfunction
autocmd BufNewFile *.spec call SKEL_spec()
" ~/.vimrc ends here