4

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.


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>


2

Use :finish: if hasNoDependency() finish endif " all dependencies are met, good to go " ... I use it for minpac plugin manager (not only here of course): if !exists('*minpac#init') | finish | endif call minpac#init() call minpac#add('k-takata/minpac', {'type': 'opt'}) "" My plugins call minpac#add('git@github.com:habamax/vim-...


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.


1

I had the same error message checking if compile and link flags for Python 3 are sane... no and was running essentially the same command. The issue was with the line: --with-python3-config-dir=/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu which was incorrect. I checked the actual location of the config using the output of: python3.7-config and ...


1

The following approach was not tested with Anaconda, but it fixed the issues for me when working with virtualenvwrapper The vim-virtualenv plugin changes the executable and modifies sys.path and the $PATH environment. I've compiled vim with python3.5, so when no virtualenv is activated I get: :py3 import sys; print(sys.executable) /usr/bin/python3 :py3 ...


1

The error you are getting is happening because your Vim doesn't include support for Python, which is required by UltiSnips, as that plug-in is implemented in Python for the most part. My recommendation is that you should get a Vim binary from your distribution. You mentioned using Linux Mint, so make sure you are not using a vim-tiny package, since that ...


1

The problem was solved. The :python3 or :pythonx (:py3 or :pyx) should be used instead of the simple :python. See :h python3 and :h pythonx. So, :py3 print("hello") gives hello as expected. Also, to see what version of Python is being used, do: :pyx import sys :pyx print(sys.version) in my case it gives 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3....


1

Check :help if-pyth: you need to use :python3.


1

Vim (when configured for dynamic python) chooses the python version to use based on the first command that run. You should use :python as the first command that runs in .vimrc or even before (config/init.vim) . It will make vim keep using python2 and disable py3. But do yourself a favor and just switch to neovim. Neovim supports real dynamic python, in ...


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


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