Closed sbeyer closed 4 years ago
Quoting from the vim documentation :
-S {file} The {file} will be sourced after the first file has been read.
This is an easy way to do the equivalent of: >
-c "source {file}"
< It can be mixed with "-c" arguments and repeated like "-c".
The limit of 10 "-c" arguments applies here as well.
{file} cannot start with a "-".
Do not use this for running a script to do some work and exit
Vim, you won't see error messages. Use |-u| instead.
As you can see, the -S
works slightly differently, it sources the given file after the first file has been read, so by this time all plugins have been loaded. When I wrote this plugin initially I remember coming across this problem and didn't find any easy way to detect if -S
or for that matter, any other command line options have been passed to vim.
Using
vim -S <sessionfile>
does not work after having a session.Steps to reproduce:
vim
, do something, do:mksession foo-session.vim
, exitvim
, do something different, exitvim -S foo-session.vim
Expected behavior:
You should be in the session of
foo-session.vim
(step 2).Observed behavior:
You are in the session of step 4.
Workaround:
:source foo-session.vim
loads the session (but replaces the current one and changes are not tracked forfoo-session.vim
).Versions: