On Fri, Feb 13, 2009 at 7:46 PM, Javier Rojas wrote:
> On Fri, Feb 13, 2009 at 03:18:26PM -0800, Lev Lvovsky wrote:
>> Often times we update files with our version control apps, and without
>> knowing it, edit the buffers, and only when attempting to write to the
>> file does vim complain about it changing - is there any more proactive
>> way to know about this?
>
> gvim takes care of this pretty well. It complains as soon as you focus
> the window.
Which can't be detected in terminal vim - 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...
au CursorHold,CursorHoldI * exe bufnr("") . 'checktime'
~Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---