Skip to main content
2 of 2
Added a link to the comment chat.
FilBot3
  • 153
  • 7

Update a Vim Session file's loaded plugins without losing window positioning

I have a Vim Session file I created by doing:

:mksession

Then I quit Vim. I then downloaded a plugin to:

${HOME}/.vim/pack/vendor/start/vim-markdown-folding

and then I fired up Vim with the session file by doing

vim -S Session.vim

Then I attempted to open the help docs for the vim-markdown-folding plugin by doing:

:helptags ALL
:help markdown-folding

Which Vim told me that it didn't exist. So I opened a new terminal tab, and tried it in a different vim session without loading the Session file. The help command worked. So I tried then to :source $MYVIMRC in the Vim that loaded the Session.vim and it still didn't update the loaded plugins. The only other way I can think of to do this is to delete the Session.vim file and reposition all my open splits and windows, which I DO NOT want to do.

How do I make Vim update the Session.vim file and the list of plugins that should be loaded when editing certain files without deleting the existing Session.vim and losing all those settings?

Why would the Session.vim file detail the plugins loaded or not update them when I tell it to :packadd or to :mksession! again or reload my $MYVIMRC?

Comment Chat is here

FilBot3
  • 153
  • 7