On 27 июл, 23:07, at <[email protected]> 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 ;).
>
You could use the following approach:
function! RunOnEmptyBuffer()
if line('$') == 1 && getline('$') == ''
echo "Buffer is empty!"
" do other stuff on empty buffer here
endif
endfunction
au BufEnter * call RunOnEmptyBuffer()
Maxim.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---