Inside a vim function I would like to have the user select a directory (instead of writing its name), I guess using :Explore, then get the filename of that directory and pass it to another function for example.
E.g. something like this
function! Test()
let directory = ????
call Test2(directory)
endfunction
This can be achieved with the browsedir() function:
function! Test()
let initialDir = '/home/'
let directory = browsedir('my prompt title', initialDir)
echo "directory = ".directory
endfunction