Loading ...
Sorry, an error occurred while loading the content.

Re: testing for an empty file

Expand Messages
  • at
    Thanks for the suggestions. I ll try Maxim s approach first. ... --~--~---------~--~----~------------~-------~--~----~ You received this message from the
    Message 1 of 4 , Jul 27, 2009
    • 0 Attachment
      Thanks for the suggestions. I'll try Maxim's approach first.

      On Jul 27, 4:56 pm, Ben Fritz <fritzophre...@...> wrote:
      > On Jul 27, 2:07 pm, at <atorgovit...@...> wrote:
      >
      > > I'm using a very nice template plugin called tSkeleton. Right now I'm
      > > operating it using an autocmd in my .vimrc:
      > >     autocmd BufNewFile *.f90      TSkeletonSetup fortran.f90
      >
      > > This works great when I start a new buffer from within .vim. However
      > > sometimes I want to touch and name a new file and then open it
      > > directly by double clicking on it in my GUI (a boorish practice, I
      > > know ;).
      >
      > > So what I would like is an autocmd for the event that a new buffer is
      > > entered AND that buffer is empty. Having checked the documentation on
      > > autocmd, I don't think such an event exists. So is there an elegant
      > > way to test for whether the file is blank or not?
      >
      > It's actually really easy to trigger your template manually. After
      > loading your empty file in Vim, just do this:
      >
      > :doautocmd BufNewFile
      >
      > You could even map a key to do this if you need it often enough.
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.