blob: 681e3daeda8c40126aacb0a1cb1ad562b5faed2b (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
" Vim plugin
" Purpose: Intelligently create content for new eselect files
" Author: Ciaran McCreesh <ciaranm@gentoo.org>,
" Elfyn McBratney <beu@gentoo.org>
" Copyright: Copyright (c) 2004-2005 Ciaran McCreesh
" Copyright (c) 2005 Elfyn McBratney
" Licence: You may redistribute this under the same terms as Vim itself
if &compatible || v:version < 603
finish
endif
" nicked from gentoo-common.vim
fun! EselectModuleHeader()
let l:year = strftime("%Y")
0 put ='# Copyright 1999-' . l:year . ' Gentoo Foundation'
put ='# Distributed under the terms of the GNU General Public License v2'
put ='# $Id: $'
$
endfun
fun! <SID>MakeNewEselectModule()
let l:pastebackup = &paste
let l:maintainer = substitute(GentooGetUser(), "^.*<\\(.*\\)>", "\\1", "g")
set nopaste
call EselectModuleHeader()
" {{{ boiler-plate eselect module
put ='DESCRIPTION=\"\"'
put ='MAINTAINER=\"' . l:maintainer . '\"'
put =''
call setline(line("."), 'SVN_DATE=' . "'" . '$Date: $' . "'")
put ='VERSION=$(svn_date_to_version \"${SVN_DATE}\" )'
put =''
put ='### foo action'
put =''
put ='## {{{ foo stuff'
put ='describe_foo() {'
put =' echo \"Perform a foobration\"'
put ='}'
put =''
put ='do_foo() {'
put =' :'
put ='}'
put ='## }}}'
put =''
put ='# vim: ts=4 sw=4 noet fdm=marker'
" }}}
norm gg=G
" {{{ go to the first thing to edit
0
/^DESCRIPTION=/
exec "normal 2f\""
nohls
" }}}
if pastebackup == 0
set nopaste
endif
endfun
com! -nargs=0 MakeNewEselectModule call <SID>MakeNewEselectModule()
augroup MakeNewEselectModule
au!
autocmd BufNewFile *.eselect
\ call <SID>MakeNewEselectModule()
augroup end
" vim: sw=4 ts=4 et fdm=marker
|