I'm writing a piece of vimscript to manage sessions. I would like to let the user configure which directory they would like the sessions to be saved in, ie:
let g:sessions_dir = "~/.vim/sessions"
I have a number of commands that let the user create and load sessions. But I would also like to provide a cmap
that let's the user tab through the sessions in that directory.
cmap GSo :wa<CR> :source ~/.vim/sessions
This works, and the user can hit TAB to cycle through their session files. However, I want to use that g:sessions_dir
variable in the cmap.