Closed gleachkr closed 6 years ago
It's a little weird, and I wouldn't want to make it the default lest people mistake it for an endorsement, but I'd certainly be open to making it possible.
What would the shebang line look like? Neither #!vim -S
nor #!/usr/bin/env vim -S
will do what you expect.
For me, #!/bin/env -S nvim -S
does the trick. -S
to env
splits the arguments in the way you'd expect.
Should I try a PR? Any suggestions in advance for how to expose the option to a user?
env -S
isn't portable.
OK. I can't find a fully portable solution. If it's optional anyway, I suppose you could configure the shebang line. But if that's a bit too fiddly for your taste, no worries.
exepath(v:progpath)
looks like it would technically work but looks strange, returning values like /Applications/MacVim.app/Contents/MacOS/Vim
and /usr/bin/vim.gtk3
.
I'd recommend starting by implementing an external solution with autocmd User Obsession
, and see how useful you find it in practice.
:+1:
It's possible to insert a shebang at the beginning of a vimscript file to specify vim or nvim as the interpreter (ref.
:help #!
).What would you think of a patch that added such a shebang to obsession's session files and made the session executable, so that you could start your session with
./session.vim
?