summaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2014-09-25 12:01:16 +0200
committerHugues Hiegel <hugues.hiegel@qosmos.com>2014-09-25 12:01:16 +0200
commitdf0075bccc56d2f16d2de64a7063f42a7c13418f (patch)
treed9d78d527ea99283b26a4a10263d9d59c905885c /vimrc
parenta71cb1e714e12d4cd6a8ab82de55ca00da3a0a5f (diff)
[vim] Skeleton files
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index f6b4d61..6ce8fbc 100644
--- a/vimrc
+++ b/vimrc
@@ -94,6 +94,15 @@ nmap <ESC>j :bn<CR>
nmap <ESC>k :bN<CR>
nmap <ESC>l :tabn<CR>
+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).