I often save my session using the following:
- In vim:
mksession! ~/session.vim
- In gvim:
mksession! ~/sessionX.vim
However, when I invoke vim with a sourcing of ~/session.vim
, I'm finding that ~/sessionX.vim
also gets sourced:
vim -S ~/session.vim
The regular expression session[Xx]
does not occur in my vimrc. This file is used by both vim & gvim; it contains if-statements to distinguish between vim & gvim, and executes the appropriate code.
I did a recursive grep in /usr/share/vim
for session[Xx]
without any hits. I did the same recursive grep in ~/.viminfo
and ~/.vim
(the latter is a folder). The only place where session[Xx]
occurs is in ~/.viminfo
, and that occurrence is simply the historical record of my mksession
command from a prior gvim session. I removed the .viminfo
file, but the sessionX.vim
still gets sourced.
I tried to track down what leads to the sourcing of sessionX.vim
using verbose messages:
cd ~
'rm' -f vimLog.txt
vim -c 'set nomore' -V2vimLog.txt -S session.vim
This logs the startup at verbosity level 2, but I also tried verbosity level 10 (the default). I can't discern anything obvious about what statements in what files are causing the rogue sourcing. (I can post an anonymized version if anyone thinks this is helpful).
Can anyone suggest another avenue of tracking down the rogue sourcing?
:echo v:this_session
?