Sunday, March 4, 2012

write to viminfo on suspend

Another strange request: I want vim to write registers and so on to viminfo
when it is suspended with ctrl-Z. I can not use the autocommand shellcmdpost
because, vim gets stopped - so it cannot itself do a :wv command.

A certain map almost works:

map <C-Z> :wv ^M \| :suspend! ^M


what this does is suspend vim twice! Apparently when one hits ctrl-Z the shell
suspends vim, and also vim suspends itself with the suspend command, because
of the map. I almost though

map <C-Z> :wv ^N

would work, because the shell would suspend, and vim would write to viminfo.
But this does not work. The map just seems to disable the suspend function of
ctrl-Z.


--
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

No comments:

Post a Comment