Closed Jasha10 closed 3 years ago
This is the conditional that decides whether to delete: https://github.com/tpope/vim-obsession/blob/96a3f837c112cb64e0a9857b69f6d6a71041155e/plugin/obsession.vim#L15-L17
So to always delete, your map will need to invert that third clause:
nmap <script> Q :<C-U>if filereadable(get(g:, 'this_obsession', v:this_session))|Obsession!|endif|qa<CR>
Hi,
What's the recommended way to guarantee that
Session.vim
is gone and the plugin has stopped?I've tried
:Obsession!
. The docs say:and this would seem to be what I'm asking for. And if a
Session.vim
file exists, it is what I'm asking for. But if aSession.vim
file does not exist, then invokingObsession!
creates a newSession.vim
file and starts tracking state, giving the opposite result.My use case is: I want to map the letter
Q
to deleteSession.vim
(if it exists) and then exit vim. I am planning another map (<Leader>E
) to ensure Obsession is running before exiting.Thanks in advance.