On 17/03/10 19:20, Lev Lvovsky wrote:
Hi Tony, sorry it's taken so long to reply!

no prob.


On Dec 19, 2009, at 9:45 AM, Tony Mechelynck wrote:

On 24/11/09 17:39, Lev Lvovsky wrote:

I'd like to run an ':mksession!' on a regular basis (automatically) -
is there a generic timer function which I can wrap around that command
(running it ever hour for example)?

thanks,
-lev

IIUC, you want to make sure that Vim will restart with "the same windows as when it 
last closed", right? For that purpose I would recommend the following:

a) to have Vim save the session at shutdown:

        autocmd VimLeave *
        \ if exists('v:dying')&&  v:dying<  2 | mksession! | endif

I _think_ this will even run at interruptible crashes (e.g., after an illegal opcode or a 
memory protect violation, but not if the operator forces an uninterruptible hard crash). 
It may or may not run at an AC power failure, depending on whether your computer can run 
a few seconds after the AC fails, and on how long the OS will leave Vim for its 
"emergency closedown".

I suppose that the only danger with this is in case I have more than one 
instance of vim running from the same directory? Is there any way to check 
whether or not the instance of vim that I'm running is actually using the 
Session.vim file?  I suppose it's possible that two instances can use the same 
session file, but that's less likely.

Thank you very much!
-lev

See ":help v:this_session" (which applies to sessions loaded by the -S switch but not to the sessions saved transparently by the Gnome versions of gvim).


Best regards,
Tony.
--
Diplomacy is the art of saying "nice doggy" until you can find a rock.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to