15 votes
Accepted

Vim 8.0 Python support

The pi-rho/dev PPA now supports Vim 8, and like it always has, includes support for Python/Python3: $ vim --version | grep python +cryptv +linebreak +python/dyn +vreplace +cscope ...
muru's user avatar
  • 24.8k
12 votes
Accepted

Installing or building vim with +python3 support for Python 3.7.x on linux

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 ...
João A. Toledo's user avatar
12 votes

Installing or building vim with +python3 support for Python 3.7.x on linux

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.
CyclicUniverse's user avatar
10 votes

How to get Python support on MS Windows?

You need to install Python yourself on Windows. If you type :version, you should see +python/dyn and +python3/dyn. On Windows, this means that Vim is compiled to dynamically load the Python DLL. You ...
Tommy A's user avatar
  • 6,750
9 votes
Accepted

How can I get python library help in vim?

Try using the jedi-vim plugin. It uses Jedi to get completions and is much better at doing so than python-rope is. It will resolve np.array to numpy.array and show the appropriate documentation in a ...
Tommy A's user avatar
  • 6,750
9 votes
Accepted

Drawbacks of using Python to develop new code in a VIM plugin

TL;DR: Requiring +python/+python3 support for a python based development plugin. That sounds completely reasonable. About Vim plugins and human behavior Generally, speaking humans want things to ...
Peter Rincker's user avatar
8 votes
Accepted

how to change python interpreter used by jedi-vim

I was able to fix it myself by providing jedi-vim with the location of the packages in my anaconda folder using the $PYTHONPATH variable as follows: export PYTHONPATH=$PYTHONPATH:/home/user1/...
R. Doe's user avatar
  • 321
8 votes

Vim 8.0 Python support

From your question it appears that you have installed vim-tiny 8.0 that is a very minimal Vim runtime without plugins. You can confirm this using this: dpkg -l | grep vim You can have several Vim ...
Yonsy Solis's user avatar
8 votes
Accepted

requires Vim compiled with Python (2.7.1+ or 3.4+) support

When you want to run ./configure, You have 3 options for python: --enable-pythoninterp=yes --with-python-command=/usr/bin/python --with-python-config-dir= last parameter is deprecated, You have to ...
PersianGulf's user avatar
8 votes
Accepted

Creating a hidden buffer

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-...
Ralf's user avatar
  • 9,157
7 votes
Accepted

How can I build vim with just python 3 support?

Thanks to x33a on the Arch forums, I was able to solve my problem. (https://bbs.archlinux.org/viewtopic.php?pid=1596987#p1596987) I changed the python 3 flag from --enable-python3interp=dyanmic to ...
Davis Yoshida's user avatar
7 votes
Accepted

How do I use Python plugins on Windows?

All right, apparently the state is this: VIM on Windows supports python 2.7.9, not 2.7.11. It might work with 2.7.10, I did not test it. Even though I compiled VIM on Windows with a reference to the ...
afontaine's user avatar
  • 311
6 votes

Vim 8.0 Python support

you should use sudo apt-get install vim-nox instead, to get a "huge-version".
skywind3000's user avatar
6 votes
Accepted

How to use the argument of a vimscript function in an inner python function?

You can use the vim package inside python, you should be able to gain access to vim: function! Test(myArgument) python << EOF import vim def test(myArgument): print "My argument " + ...
nobe4's user avatar
  • 16k
6 votes

Vim 8.0 Python support

Solution 1 : Install VIM Editor(Install any one of them of vim variant) : vim-gtk3 :- This package contains a version of vim compiled with a GTK3 GUI and support for scripting with Lua, Perl, ...
finn's user avatar
  • 271
6 votes
Accepted

How to write a plugin that works for both Python3 and python?

See help pythonx in Vim 8: Because most python code can be written so that it works with python 2.6+ and python 3 the pyx* functions and commands have been written. They work exactly the same as ...
laktak's user avatar
  • 2,913
5 votes

How can I build vim with just python 3 support?

The problem was not in Vim's default Python interpreter. The real root of the problem is that the last version of jedi-vim (0.7.0) was released in 2013 and did not work well with Python 3. Since ...
user576557's user avatar
5 votes

Vim 8.0 Python support

You should install vim from source. That way, you have control over what is included. See the following for more info and a step by step walkthrough. It is relatively easy. https://github.com/...
Xero Smith's user avatar
5 votes

Elegant way to support both python and python3 in vim plugin

If you want to avoid rewriting the Python script, put it in a separate file and use :pyfile or :py3file instead. let script_path = expand('<sfile>:p:h') . '/script.py' if !has('python') and !...
Tommy A's user avatar
  • 6,750
5 votes
Accepted

Vim is unable to find Python

Have a look at :help python3 and the subsequent sections on python-2-and-3 and pythonx. If python is compiled with +python/dyn, +python3/dyn, then it effectively has support for Python 2 and 3. ...
superphunthyme's user avatar
5 votes

How to run a python command based on a matched group of a pattern?

TL;DR There is no simple way to get capture groups into other commands. They simply don't see them. About the :s command As many vim users know, :s is the :substitute command, and it deals in vim's ...
D. Ben Knoble's user avatar
  • 25.8k
5 votes
Accepted

Quit script after a certain condition is true

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') | ...
Maxim Kim's user avatar
  • 13.1k
4 votes

How do I get Vim to be able to run both python and python3 on a Linux system in the same session?

Ubuntu 16.04 now has vim-*-py2 packages included in the repo. This means all Debian Vim users can migrate to Ubuntu if needed. The erstwhile vim-* packages now provide +python3, and the binaries are ...
dfggdfgdfgdfgdfgdfgdfgdfg's user avatar
4 votes

how to change python interpreter used by jedi-vim

You can't. The :python and :python3 commands always use the compiled-in interpreters. If you have a recent version of Vim with python and / or python3 loaded dynamically (see :h python-dynamic) you ...
Sato Katsura's user avatar
  • 4,009
4 votes
Accepted

How can I get more features?

If you want more features (and something more up to date than whats in the apt packages), you have to compile it yourself. You say you are on Debian, and all these should work on that platform. You ...
DoYouEvenCodeBro's user avatar
4 votes
Accepted

How to assign a Python list to a vim variable and escape its strings correctly

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')
Mass's user avatar
  • 14k
4 votes

Inserting text with the Python interface

It is generally easier to use pyeval (py3eval, pyxeval) and the expression register: imap <c-x><c-r> <c-r>=pyxeval('python expression')<cr>
Mass's user avatar
  • 14k
4 votes
Accepted

Programming Vim in Python: how is it implemented?

The source files used for the Python integration with Vim are: https://github.com/vim/vim/blob/master/src/if_python.c https://github.com/vim/vim/blob/master/src/if_python3.c https://github.com/vim/vim/...
Yegappan Lakshmanan's user avatar
3 votes

how to change python interpreter used by jedi-vim

2018+ Jedi Versions You can just use :let jedi#force_py_version=3.8 if you want to switch to the latest Python version, for example. Unfortunately there is no environment listing in jedi-vim, yet. We ...
Dave Halter's user avatar
3 votes

Python integration in Vim on Raspberry Pi

If you are looking for a terminal version of vim which supports python (alongs with Lua, Perl, Ruby, and Tcl) without a GUI. I'd recommend to use the vim-nox package. You can install it with sudo ...
statox's user avatar
  • 49.6k

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