I’ve been experimenting with Thomas Link’s excellent tSkeleton plugin for the vim editor recently.
tSkeleton provides file templates and code skeletons which are parsed and expanded when you edit your code. It currently comes with templates for PHP, Ruby, vim scripting and many other languages too.
There are some parts of tSkeleton which will only work when using the gtk-gui version of vim (or the Windows version); the popup menus for example but I’m not going to let that stop me.
This is a brief outline of how I got it working after a few false starts:
- Download the multvals and genutils scripts that tSkeleton requires from vim.org and uncompress them until some useful directory. I put them into my
/home/kguest/config/vim/scripts/directory. - Add entries to your ~/.vimrc to source these files:
source /home/kguest/config/vim/scripts/multvals.vim
source /home/kguest/config/vim/scripts/genutils.vim - Download the tSkeleton.zip file and uncompress it’s contents into your
~/.vimdirectory. - Add lines similar to these into your ~/.vimrc
autocmd BufNewFile ~/.vim/skeletons/*.suffix TSkeletonSetup othertemplate.suffix
autocmd BufNewFile *.suffix TSkeletonSetup template.suffix
- Next you’ll need to copy a directory or two from
~/.vim/skeletons/bits.samples/to~/.vim/skeletons/bits/- I only copied the php directory over. - Finally you may want to set some some details in your .vimrc so tSkeleton can expand the templates with slightly more meaningful information. I added these lines:
let tskelUserName='Ken Guest'
let tskelUserEmail='ken@guest.cx'



















