"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let $VIMHOME = $HOME.'/.vim'
+if !isdirectory($VIMHOME) | let $VIMHOME = '/opt/nb/etc/vim' | endif
"let $VIMHOME = '/home/nico'.'/.vim'
" let vimhome = '/home/nico/.vim'
let $VIMPLATE_DIR = $VIMHOME . '/templates'
+
+let $VIMPLATERC = $HOME.'/vimplaterc'
+if !filereadable($VIMPLATERC) | let $VIMPLATERC = '/opt/nb/etc/vim/vimplaterc' | endif
+
let $VIMPLATE = 'vimplate'
-let $VIMPLATE = $VIMPLATE . ' -user nico'
+" NB 18.01.15 let $VIMPLATE = $VIMPLATE . ' -user nico'
-let $VIMPLATE = $VIMPLATE . ' -config '.$VIMHOME.'/vimplaterc'
+let $VIMPLATE = $VIMPLATE . ' -config '.$VIMPLATERC
let $VIMPLATE = $VIMPLATE . ' -dir '.$VIMPLATE_DIR
--- /dev/null
+# This is an example configuration.
+# please see: http://napali.ch/vimplate
+
+# you can use $Config::opt instead command options:
+# -user=<user> -dir=<dir>
+#warn @ARGV;
+use POSIX;
+
+sub filename {
+ my $f = $ENV{VIMFILE};
+ return $f unless $f;
+ my $root = $ENV{IZI_ROOT_DIR};
+ return $f unless $root;
+ $f =~ s,^$root,\~izideal,;
+ return $f;
+}
+
+$Config::var = {
+ #yourArray => [ 'Perl', 'C', 'C++' ],
+ time => sub{ time },
+ programname => 'nico',
+ today => POSIX::strftime("%d.%m.%y", localtime),
+ year => POSIX::strftime("%Y", localtime),
+ filename => &filename(),
+};
+
+$Config::opt = {
+ dir => $ENV{HOME}.'/.vim/templates',
+ #dir => '/usr/share/vim-scripts/vimplate-templates',
+ user => 'nico',
+};
+
+
+# we need $Config::user with the option -user=<name>
+$Config::user = {
+ nico => {
+ firstname => 'Nicolas',
+ lastname => 'Boisselier',
+ me => 'NB',
+ #mail => 'icolas@free.fr',
+ mail => 'nicolas.boisselier@gmail.com',
+ },
+};
+
+for (keys %$Config::user) {
+ my %h = %{$Config::user->{$_}};
+
+ $h{name} = $h{firstname}.' '.$h{lastname};
+ $h{author} = $h{name}.' '.$h{mail};
+
+ $h{me_now} = $h{me}.' '.$Config::var->{today};
+
+ $h{copyright} = "(C) ".$Config::var->{year}." ".$h{name};
+
+ $h{copyright_laius} = "Copyright $h{copyright}
+
+This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+See <http://www.gnu.org/licenses/>.";
+
+ $Config::user->{$_} = \%h;
+};
+1;