6

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 \ --with-python3-config-dir=/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu \ ... (other config params) ... HTH


4

It is generally easier to use pyeval (py3eval, pyxeval) and the expression register: imap <c-x><c-r> <c-r>=pyxeval('python expression')<cr>


4

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. In VimScript: 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 ...


3

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:...


2

For a vim plugin with python, you may first import the vim module (see :h python-vim). import 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.


2

Use pyeval(), py3eval(), or pyxeval() to read python variables into vim: python: x = [1,2,3] vim.command('let X = pyeval("x")') vim: py x = [1,2,3] let X = pyeval('x')


1

In vimscript, just as an alternative: :1,$-1substitute/$/: :global/^/join In one line with abbreviated commands: :1,$-1s/$/:/ | g/^/j


1

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[:]) ]


1

if you want to use : py, you probably should use vim.command function dosomething() :py import vim :py vim.command("let tt ='text' ") return tt endfunction and call it by <C-R>=dosomething() or function dosomething() :py import vim :py vim.command("norm i"+ 'TEXT' ) endfunction and call it by <esc>:call ...


1

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 ...


1

make clean distclean before running the configure command for vim. This worked for me. There was lots of cached items hanging around from before that were interfering with vim configure.


Only top voted, non community-wiki answers of a minimum length are eligible