Quantcast
Viewing all articles
Browse latest Browse all 43

Vimrc using a variable inside a cmap

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.


Viewing all articles
Browse latest Browse all 43

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>