> For example, if I'm editing a file, and the file has been
> modified by external tool, say echo foo >> file, since the
> last time I haved saved, then now after I'm finishing the
> editings and want to write the file to disk, then vim will
> warn that file has been changed, what should I do? 1) Abandon
> my editing; 2) Abandon the changes by external tool. Both of
> them are not so good.
If something has changed the file that I'm currently editing
(such as a parallel edit session or a automated script), I'll
often yank my buffer into a new one:
:%y
:new
:0put
:$d
then switch back to my original buffer and reload it:
:e!
and compare the two buffers:
:windo diffthis
(assuming only two windows are open...otherwise, visit each one
and ":diffthis" on it.)
This allows me to get/put differences in the files. If it was
something that happened frequently, I'd likely create a few
mappings to facilitate it. Or perhaps the "DiffOrig" command
(":help DiffOrig") instead.
-tim
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---