Red Hat Bugzilla – Bug 1303304
gvim windows are empty when restoring saved session in KDE
Last modified: 2016-04-20 07:09:59 EDT
Description of problem:
Gvim does not work with KDE's session management.
Version-Release number of selected component (if applicable):
I don't know if this is a problem in gvim or in KDE (and I never know which component of KDE is relevant to a bug):
Steps to Reproduce:
1. Open some files in gvim
2. Have KDE set to either restore session on login, or restore saved session.
3. Log out of KDE (saving session manually if required by configuration) and log back in.
Gvim windows are restored, but without an open file, and with $HOME as the working directory.
Gvim windows should be restored with the previously open files and working directories.
I read somewhere that having 'set guifont' in gvimrc prevents sessions being restored correctly in KDE, but removing that line doesn't seem to help in Fedora. It's also not a good workaround, as I don't want to have to use the default font (or large default font size).
I think you need either a plugin like http://www.vim.org/scripts/script.php?script_id=3150
or use something like
'autocmd VimLeavePre * mksession! .vim.sess' and
gvim -S .vim.sess as described at http://superuser.com/questions/148802/restore-session-in-gvim-like-in-firefox
Neither solution is something I would like to add to vim atm. Session management really needs to be fixed upstream. Better support for mksession is one of the features that VIM sponsors have voted upon, but is is way down the list: http://www.vim.org/sponsor/vote_results.php
Thanks, that makes sense (although I'd say in that case KDE should not be trying to save gvim windows at all if it doesn't work).
The plugin looks useful, especially if I can somehow get KDE to trigger it when saving a session. Thanks again.