text: Q:
  
  VIM prompting for a variable when running a macro?
  
  I find I waste a lot of time closing and reopening sets of files so I'd like to improve my VIM macro for loading and saving the session to support multiple sessions.
  I'd like for it to prompt for a string value, so that I could press my shortcut, then type in for example "foo", and have my macro save the session to .foo (so I also need to do basic string concat on it). Then I'd do the same for the load macro and manage sessions by theme (using MVC framework you tend to have a lot of files to work with).
  " Control-S to save and Shift F5 to load
  set sessionoptions=tabpages,winpos
  map <S-F5> :source ~/.vim/.session<cr>
  map <c-s> :mksession! ~/.vim/.session<cr>\| :echo "Session saved."<CR>
  
  I have very little experience of VIM scripting. Is it possible to do this in a one liner, or perhaps a small function?
  Thank you.
  
  A:
  
  map <s-f5> :execute "source ".input("session name: ", "~/.vim/session.", "file")<cr>
  
  Enter "foo" to load "session.foo".
  Instead, you can also do:
  map <s-f5> :source ~/.vim/session.
  
  Note there isn't a <cr>, so you complete the command yourself and press enter — identical typing as above, even down to filename completion.
  However, I'd look at calling a function or something else entirely at about this point.
  
  