Probably your default python3 is 3.6. You need, then, tell the build process to use python3.7. You can do that with the parameters --with-python3-command:
./configure --with-python3-command=python3.7 \
... (other config params) ...
I'm not aware that you can create a hidden unnamed buffer.
But you can create a hidden (even unlisted) buffer with some fancy name and use that.
let g:myscratch = bufnr("my-fancy-name", 1)
call setbufvar(g:myscratch, "&buftype", "nofile")
The first line returns the buffer number for the buffer named "my-fancy-name". If the buffer does ...
Vim can be build with static python or dynamic python support. If it is build with dynamic python you are able to change the python version.
Just look at the output of :version. If it contains +python/dyn and +python3/dyn, it is compiled for dynamic python. Then you are able to change the python dll to use by changing the option pythondll or pythonthreedll:...
For a vim plugin with python, you may first import the vim module (see :h python-vim).
Then there is vim.command(cmd) to execute an Ex command, so in your case
vim.command('let g:cmake_configuration_name=' + python_variable)
should do the job.
vim.current.buffer refers to a buffer object.
vim.current.buffer[:] on the other hand, is a list of strings containing the content of the buffer.
You can manipulate the lines of the buffer by retrieving and assigning to this list:
py3 vim.current.buffer[:] = [ ':'.join(vim.current.buffer[:]) ]
if you want to use : py, you probably should use vim.command
:py import vim
:py vim.command("let tt ='text' ")
and call it by <C-R>=dosomething()
:py import vim
:py vim.command("norm i"+ 'TEXT' )
and call it by <esc>:call ...
You definitely need the backslash version \<Left>. Is use of py3eval necessary? Unless you need to translate data structures from Python to Vim or something it would be better to return a straight string. You need to make sure the string :GrepperAck ''\<Left> is passed literally to the command line. Then it will be processed as an expression due ...