On 2/15/09, Lev Lvovsky wrote:
> On Feb 14, 2009, at 1:03 AM, Matt Wozniski wrote:
>
>>> gvim takes care of this pretty well. It complains as soon as you
>>> focus
>>> the window.
>>
>> Which can't be detected in terminal vim
>
> Is that to say that when you change to a different buffer, vim can't
> immediately check the status of that buffer for having been changed?
No, that can certainly be detected. I never realized that terminal vim
doesn't handle that... I meant that there's no way for vim to tell when
the terminal window has lost or gained focus. When you switch windows,
you could always use something like this:
autocmd WinEnter,BufWinEnter * :exe bufnr('') . 'checktime'
>> - but I think this will get
>> you pretty close: This command will cause vim to check if the file
>> has been modified every time you let the cursor sit still for
>> 'updatetime' seconds, so it won't be instantaneous, but will probably
>> be when you're making your next edit to or movement around the buffer.
>> You could also add CursorMoved,CursorMovedI if you wanted to be
>> *really* agressive, but if your OS actually checks with the filesystem
>> every time :checktime is run, that might get annoying...
>
> This will definitely work. Certainly if I'm editing a file and not
> changing buffers, this is good (and changes do happen underneath them
> for us much of the time) - I would just think that changing to another
> could kick off all sorts of things...
~Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---