From df0075bccc56d2f16d2de64a7063f42a7c13418f Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 25 Sep 2014 12:01:16 +0200 Subject: [vim] Skeleton files --- skel/c | 15 +++++++++++++++ skel/h | 20 ++++++++++++++++++++ vimrc | 9 +++++++++ 3 files changed, 44 insertions(+) create mode 100644 skel/c create mode 100644 skel/h diff --git a/skel/c b/skel/c new file mode 100644 index 0000000..053e31a --- /dev/null +++ b/skel/c @@ -0,0 +1,15 @@ +/* + This file is a part of Qosmos ixEngine. + + Copyright Qosmos 2000-<+strftime("%Y")+> - All rights reserved + + This computer program and all its components are protected by + authors' rights and copyright law and by international treaties. + Any representation, reproduction, distribution or modification + of this program or any portion of it is forbidden without + Qosmos explicit and written agreement and may result in severe + civil and criminal penalties, and will be prosecuted + to the maximum extent possible under the law. +*/ + +<=CURSOR=> diff --git a/skel/h b/skel/h new file mode 100644 index 0000000..dbdaa9f --- /dev/null +++ b/skel/h @@ -0,0 +1,20 @@ +/* + This file is a part of Qosmos ixEngine. + + Copyright Qosmos 2000-<+strftime("%Y")+> - All rights reserved + + This computer program and all its components are protected by + authors' rights and copyright law and by international treaties. + Any representation, reproduction, distribution or modification + of this program or any portion of it is forbidden without + Qosmos explicit and written agreement and may result in severe + civil and criminal penalties, and will be prosecuted + to the maximum extent possible under the law. +*/ + +#ifndef <+substitute(toupper(expand("%:t")), "\\.", "_", "g")+> +#define <+substitute(toupper(expand("%:t")), "\\.", "_", "g")+> + +<=CURSOR=> + +#endif /* <+substitute(toupper(expand("%:t")), "\\.", "_", "g")+> */ diff --git a/vimrc b/vimrc index f6b4d61..6ce8fbc 100644 --- a/vimrc +++ b/vimrc @@ -94,6 +94,15 @@ nmap j :bn nmap k :bN nmap l :tabn +augroup skel + au! + " read in skeleton files + autocmd BufNewFile *.* silent! 0r ~/.vim/skel/%:e + autocmd BufNewFile * silent! %substitute#<+\(.\{-\}\)+>#\=eval(submatch(1))#ge + " get to cursor position + autocmd BufNewFile * silent! %substitute#<=CURSOR=>##g +augroup END + " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). -- cgit v1.2.3