I want to know when I should call RestoreSession() function and when not. Because when I open single file, I don't want to see my project's files, which i save to vim session before.
For example if I call vim like this: vim -n test.rb
. How me to detect n
key in vimrc? (I want use n key as something like custom indicator for my purpose)
It's all, small question :-)
In private conversation, @Nicklasos suggest me another way how to do what I need - using argv() function. It is just:
if argc() == 0
autocmd VimEnter * call RestoreSess()
end
You can run vim with -c key (Execute command upon startup)
vim -c RestoreSession foo.txt
Also, you can write bash alias.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With