On 9/16/07, Nikolai Weibull <[EMAIL PROTECTED]> wrote:
>
> % vim
> :new
> :autocmd BufWinLeave <buffer=1> :2wincmd w | quit
> :wincmd p
> :q
>
> Guess what, buffer 1 is still loaded and displayed.  Like, WTF?
>
> The reason I want to do this is that I have opened a window that I
> want to be dependent on the first window being visible.  This is for
> doing diffs.    I've tried basically every combination of autocmds I
> could think of, but nothing works.

This works:

autocmd BufWinLeave <buffer=1> :qall!

and looks to me much better than your example if
you indend to quit vim from autocommand.

Your example btw works same way with buffer-local
autocommands, or with buffer-name-based autocommands,
same way.

If, instead of quitting vim, you want to close the other window,
you can use :bd 2 or :bw 2 in the autocommand.

Yakov

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui