[pm-h] One-line filetype template system in vim

Julian Brown jlbprof at gmail.com
Sat Jan 14 12:56:18 PST 2017


Thanx Wade

On Sat, Jan 14, 2017 at 10:43 AM, G. Wade Johnson via Houston <
houston at pm.org> wrote:

> In part of my talk on Thursday, I showed how I do filetype templates in
> vim. Several people asked for a copy.
>
> Add the following line in your .vimrc
>
>   autocmd BufNewFile * silent!    0r ~/.vim/templates/%:e.template
>
> and create the directory ~/.vim/templates.
>
> When creating a new file, this will cause vim to look in the template
> directory for a file named {file_extension}.template and load it first.
>
> Here's my template pl.template
> -------------------
> #!/usr/bin/env perl
>
> use strict;
> use warnings;
> use 5.010;
>
> -------------------
>
> Have more vim fun.
> G. Wade
> --
> A product's only late once, but it can suck forever.
>                                      -- Ben Spees, Ambrosia Software
> _______________________________________________
> Houston mailing list
> Houston at pm.org
> http://mail.pm.org/mailman/listinfo/houston
> Website: http://houston.pm.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/houston/attachments/20170114/ef7aff1a/attachment.html>


More information about the Houston mailing list