Vim skeletons

| | [C]olor

To trigger Vim skeletons add this to ~/.vimrc:

function! SetSkeletons()
  for file in systemlist('find ~/.vim/skeleton')
    let extension = substitute(file, '.*\.', '', '')
    execute "au BufNewFile *.".extension." 0r ".file." | $d"
  endfor
endfunction
call SetSkeletons()

When opening a new file Vim will load the corresponding template from ~/.vim/skeleton/skeleton.{extension}.