Phew!
Thanks for all the quick responses! There are a multitude of ways to
do it I guess. The abbreviation method seems the simplest for me at
the moment, but I can't seem to figure out how to make a multiline
abbreviation in my .vimrc file. I've tried using <CR> characters in
the string and quoting it as well.. both to no avail. Any hints?
Thanks again for the great help.
On 11/2/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
Tim Chase wrote:
[Richard Querin wrote:]
>> Anyway, one thing I'd like to be able to do is insert some
>> boilerplate text into a document - something like a standard
>> signature. Is there some way I can preload a buffer with this
>> text when I run Vim? Can this be done in the rc file? I'm sure
>> there is a way (with Vim there always seems to be) but I can't
>> seem to find out how.
>
>
> In your vimrc, you can add a line something like
>
> au BufNewFile *.txt $r ~/template.txt
>
> where "*.txt" is the pattern to match. Thus, if you do:
>
> :e nonexistant.txt
>
> it will automatically read in the file "~/template.txt" at the bottom of
> the file ("$").
[...]
Or, to insert the boilerplate after the cursor line at any time during
editing, use simply
:r ~/template.txt
A line number can be inserted between : and r to mean "insert after line n"
(or 0 to insert before first line, or $ to insert after last line, or... see
":help [range]").
Best regards,
Tony.