-
Notifications
You must be signed in to change notification settings - Fork 80
Vim
tetov edited this page Apr 24, 2019
·
5 revisions
You need a VIM version that has been with Python 2.7 or later (+python or +python3). You can check this from within VIM using :python3 import sys; print(sys.version) (use :python for Python 2).
- Install jedi-vim (or another autocompletion plugin that supports jedi) either manually or using your preferred plugin manager.
- Make sure you do not have other autocomplete plugins loaded.
- Make sure you have the autocomplete engine working for the native Python libraries.
- Append the path to the stubs to the
PYTHONPATHvariable in your shell profile (e.g..bash_profile/.bashrc/.zshrc) using the commandexport PYTHONPATH=${PYTHONPATH}:/path/to/iron-python-stubs/release/stubs.min - Put
let g:jedi-vim#force_py_version = '2'in your.vimrcif you have Python 3 in your environment. - You are now ready to complete using jedi-vim, the standard keymap is
<C>-<Space>. You can use ervandew/supertab to easily map completions to<Tab>.
If you have other libraries you would like to add like rpw, you add multiple paths using a colon.
PYTHONPATH=${PYTHONPATH}:/path/to/iron-python-stubs/release/stubs.min:/path/to/revitpythonwrapper.lib
Some additional context for these instructions can be found in this blog post: Autocompletion for Rhino/Grasshopper python scripts in Vim