Thursday, August 23, 2012

Re: Autocmds

On Thursday, August 23, 2012 5:48:50 AM UTC-5, Jan wrote:
> On Wednesday, 22 August, 2012 at 17:43:31 BST, Gary Johnson wrote:
>
> >You can use FileType autocommands in your ~/.vimrc like this,
>
> >
>
> > au FileType perl setlocal tw=2
>
>
>
> That seems to be fine for when a Perl file is opened (although I'm not sure what event triggers it -- BufNewFile? BufRead?),

The event is a FileType event. It fires whenever you or Vim set the filetype to perl.

> but if I have autocmds that execute upon specific events, for example:
>
>
>
> au BufWritePost *.pl make
>
>
>
> how would I feed BufWritePost to your example?
>

Switch to checking filetype instead of file extension, something like:

au BufWritePost * if &ft=='perl' | make | endif

--
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

No comments:

Post a Comment