Thanks, but I should have explained that I already tried that and it doesn't work. I know that BufWinEnter is supposed to get run after modelines, but apparently the +cmd commands get executed after modelines...and the BufWinEnter events.
In JavaScript, a common pattern to run some code after the page has finished loading is to schedule a function to run at 0 seconds in the future (none of the timer-driven events get processed until after the page is fully loaded). I wondered if there was a corresponding pattern in vimscript and if that's what I needed to do in this case. On Thursday, February 13, 2014 6:07:33 PM UTC-5, Tony Mechelynck wrote: > On 13/02/14 16:38, Aaron Bohannon wrote: > > > Let's say I open a scratch buffer like this: > > > > > > :new +set\ buftype=nofile > > > > > > How can I set up an autocmd that will run when the buffer opens and have > > access to the information that &buftype == 'nofile'? > > > > > > > You may want to attach to a different event depending on what you mean > > by "when the buffer opens" but maybe > > > > :au BufWinEnter * if &buftype == 'nofile' | call DoSomething() | endif > > > > See :help autocommand-events > > > > > > Best regards, > > Tony. > > -- > > hundred-and-one symptoms of being an internet addict: > > 86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself. -- -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
