tpope / vim-obsession

obsession.vim: continuously updated session files
http://www.vim.org/scripts/script.php?script_id=4472
1.74k stars 68 forks source link

Passing Args to `Obsess` Not Working #30

Closed ghost closed 7 years ago

ghost commented 7 years ago

First off, great plugin. Nice work @tpope! Second, I'm having trouble passing args to the Obsess function (in the event that I need to create a new session with a custom file name).

Is this something to do with vim-obsession, or something else on my end I can fix?

" Obsession {
nmap <Leader>s :call ToggleObsess()<CR>

function! ToggleObsess()
    let d=FindRootDirectory()."/.session.vim"
    if !empty(glob(d))
        " Load previous session
        source d
    else
        " Create new session
        Obsess d
    endif
endfunction
" }

Much appreciated,

Brandon

tpope commented 7 years ago
exe 'Obsess' fnameescape(d)