On 17/04/09 19:36, David C. wrote: > > Hi everyone, > > Long time user, first time caller. > > In this case I'm using gvim on windows xp, but I think this applies to > most vim situations. > > When you attempt to open a text file that was closed abnormally > before, leaving a hidden .swp file, your open is interrupted by > something like: > Swap file "filename.txt.swp" already exists! > > and an explanation, and it gives you choices such as Open read-only, > Open for edit anyway, Recover, Delete swap file, Quit. > > What I normally do, and what the text that comes on the screen in the > above situation recommends, is Recover the swap file, write it out to > "filename.txt2", then quit and do a diff (using diff or gvim -d, or > Winmerge, or whatever you feel like), to see what the differences are > and which one I want to keep. In most cases, there are no > differences, because the file had been open but sitting still for > awhile before the crash. > > So instead of doing all these steps, it would be much more efficient > if one of the options (in the popup dialog box in my case) was to let > you see a diff with the click of a button. It could be a gvim -d with > the file on disk on the left and the recovered file on the right, or > it could be a simple "diff" output run up the screen in the same > "output text" mode (I don't know what it's called, but the same way > the swap file warning went up the screen, but isn't in any buffer). > > But basically I'd like to one-click see if there were any differences > or be able to see the differences at a glance if it's a small diff, > and then in another click (or keystroke) delete the swap file and > proceed with editing. > > A whole other approach to this would be to report the number of diffs > along with the initial warning message, although I assume it's less > preferable because then you're running a diff without the user's > permission (could take along time on a big file), and the user still > has to go through the other steps in the less common cases where there > is a diff and they want to see it. > > Thanks, > David
Long before even Windows existed, in fact before Unix-like OSes for PCs (unless you call MS-DOS 2 a Unix-like OS; I don't) were known (at least this side of the Atlantic), I learnt to save my editfile whenever I leave the keyboard or at least once every quarter-hour in any case. I never unlearnt this reflex; in fact I believe it's still useful, even with present-day hardware and software. As a result, even in the case of a crash I only rarely have an unsaved file open in Vim. So when that |ATTENTION| message comes up, what I do is check the line that says whether the file was modified. If it's "modified: no" (my usual case), it tells me that the file wasn't 'modified' at the time of the crash, and in that case I simply delete the swapfile with no compunctions and continue editing. Best regards, Tony. -- "The wages of sin are death; but after they're done taking out taxes, it's just a tired feeling:" --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
