Thursday, December 10, 2020

Re: Vim-script question

arocker@Vex.Net wrote:
>> I want to include in my .vimrc an autocommand that writes some new lines
>> into an empty file e.g. an zsh script.
>>
> A possible alternative is to use a "here" document containing whatever
> boilerplate you want, in a shell script that then opens vim on the
> resulting file.
>
Another alternative: in your $HOME/.vim/filetype.vim :

    au BufNewFile *.zsh  :0r $STUB/stub.zsh

You'll have to set up a STUB environment variable a path to a directory
you set up.
Then, put stub.zsh in there with whatever you'd like to start your zsh
file with.

Repeat for whatever other filetypes you want.

Regards,
Chip Campbell

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/78eb93bd-4092-a77c-f268-baf42ded1c5e%40drchip.org.

No comments:

Post a Comment