On 13/05/09 08:39, J wrote:
>
> Hello,
>
> I am wondering if these 2 things can be done in gvim:
>
> 1. Save all the opened files. I usually have many files open in a
> split window. It'd be nice if I can save this 'desktop' and restore it
> whenever I reopen gvim.
[...]
What you need is a session file. However, if the ":mksession" command
can indeed generate a session file for the files currently open in Vim,
in my experience the session file produced is often unnecessarily bulky.
See
:help -S
:help :mksession
My session (the set of files I load in split-windows in a common Vim
instance) is rather stable, and after using ":mksession" for some time,
I have found that what suits me best is to write my session file by
hand, as a Vim script named ~/Session.vim -- the default name for a
script which Vim will source at the end of startup when invoked from the
home directory as "gvim -S" or "vim -S". Even for as many as 21
split-windows, my current ~/Session.vim (written by hand) is quite
manageable, as follows:
e ~/.mozilla/sunbird/8jrlswxe.default/user.js
new ~/.mozilla/seamonkey/nexrdon9.default/user.js
new ~/.mozilla/seamonkey/nexrdon9.default/chrome/userChrome.css
new ~/.mozilla/seamonkey/nexrdon9.default/chrome/userContent.css
new ~/.mozilla/seamonkey/nexrdon9.default/chrome/userChrome.js
new ~/.mozilla/firefox/x5sh35vw.testing/user.js
new ~/.mozilla/firefox/x5sh35vw.testing/chrome/userChrome.css
new ~/.mozilla/firefox/x5sh35vw.testing/chrome/userContent.css
new ~/.mozilla/firefox/15jqlowi.16may2006/user.js
new ~/.mozilla/firefox/15jqlowi.16may2006/chrome/userChrome.css
new ~/.mozilla/firefox/15jqlowi.16may2006/chrome/userContent.css
new ~/.mozilla/firefox/15jqlowi.16may2006/chrome/launchy.xml
new ~/.thunderbird/0g7ur1s6.default/chrome/userChrome.css
new ~/.thunderbird/0g7ur1s6.default/chrome/userContent.css
new ~/desktops.txt
new ~/deviantart.txt
new ~/942philo.txt
new $VIM/vimfiles/keymap/russian-phonetic_utf-8.vim
new
lcd ~/pub/slovarj
e ru-fr.css
new ru-fr.abbrev.html
new ru-fr.03.html
setl keymap=russian-phonetic
let $VIMSRC = '/root/.build/vim/vim72'
sleep 3
intro
As you can see, any ex-commands which are deemed to be specific to the
current session can be written into a session file, which, in last
analysis, is "just" a plain Vim-script. "Common" settings applicable to
"any" run of [g]vim (including the session but not limited to it) can
best be left in the vimrc. (And BTW, don't look online or in a Vim
distribution for that keymap, it's one I wrote for my own use because
the Russian keymaps distributed with Vim didn't suit me.)
Best regards,
Tony.
--
The surest protection against temptation is cowardice.
-- Mark Twain
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---