mirror of
1
0
Fork 0

Remove jedi-vim

If it's there, it throws an error if jedi isn't installed for Python.

Fixes https://github.com/amix/vimrc/issues/716
This commit is contained in:
Amir 2022-11-20 12:24:49 +01:00
parent a4e59b561f
commit 9bab0e48c8
37 changed files with 0 additions and 4201 deletions

View File

@ -109,7 +109,6 @@ I recommend reading the docs of these plugins to understand them better. Each pl
* [gist-vim](https://github.com/mattn/gist-vim) Easily create gists from Vim using the `:Gist` command
* [vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides) Is a plugin for visually displaying indent levels in Vim
* [editorconfig-vim](https://github.com/editorconfig/editorconfig-vim) EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
* [jedi-vim](https://github.com/davidhalter/jedi-vim) A great Python autocompletion library for VIM.
## Included color schemes
@ -358,14 +357,6 @@ Open [ctrlp.vim](https://github.com/kien/ctrlp.vim) plugin to quickly find a fil
nnoremap <leader>v :.GBrowse!<CR>
xnoremap <leader>v :'<'>GBrowse!<CR>
[jedi-vim](https://github.com/davidhalter/jedi-vim) specific mappings (can be used to browse through Python code quickly):
let g:jedi#goto_assignments_command = "<leader>a"
let g:jedi#usages_command = "<leader>u"
let g:jedi#completions_command = "<C-Space>"
let g:jedi#rename_command = "<leader>r"
### Spell checking
Pressing `<leader>ss` will toggle spell checking:

View File

@ -1 +0,0 @@
github: [davidhalter]

View File

@ -1,44 +0,0 @@
### Issue
<!--
Please describe the issue here.
If you are not using jedi-vim from Git (but e.g. from a distribution's package,
please try it with jedi-vim's Git master, too).
-->
### Steps to reproduce
<!--
Include if relevant.
Please provide steps to reproduce it here, preferably based on a minimal Vim
configuration.
You can use the following template (save it as `minimal.vimrc` in the directory
where jedi-vim is installed, `cd` into that directory, and run Vim with
`vim -u minimal.vimrc`):
```
set nocompatible
let script_dir = fnamemodify(expand('<sfile>'), ':h')
let &runtimepath .= ','.script_dir.','.script_dir.'/after'
" Put your config changes here.
" let g:jedi#show_call_signatures=1
syntax on
filetype plugin indent on
```
Please provide the `minimal.vimrc` you have used here, too.
-->
### Output of “:verbose JediDebugInfo”
<!--
Please execute `:redir @+> | silent verb JediDebugInfo | redir END` in a
Python buffer to copy debug information into your clipboard.
Then paste it here.
-->

View File

@ -1,63 +0,0 @@
name: ci
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup
run: |
sudo pip install pytest
vim --version
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Run tests
run: 'make test'
code-quality:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Run tests
run: |
vim --version
make check
coverage:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo add-apt-repository ppa:neovim-ppa/stable -y
sudo apt-get update -q
sudo apt-get install neovim -y
sudo pip install pynvim pytest-cov
sudo pip list
nvim --version
- name: Run tests
run: |
make --keep-going test_coverage BUILD_VIRTUAL_ENV=$VIRTUAL_ENV
- name: Upload coverage data
run: |
coverage xml
bash <(curl -s https://codecov.io/bash) -X fix -f coverage.xml -F py${TRAVIS_PYTHON_VERSION//./}

View File

@ -1,8 +0,0 @@
*~
*.sw?
*.py[cod]
.ropeproject
doc/tags
.pytest-cache
build
.coverage*

View File

@ -1,6 +0,0 @@
[submodule "jedi"]
path = pythonx/jedi
url = https://github.com/davidhalter/jedi.git
[submodule "pythonx/parso"]
path = pythonx/parso
url = https://github.com/davidhalter/parso.git

View File

@ -1,31 +0,0 @@
dist: bionic
language: python
python: 3.8
env:
- ENV=test
- ENV=check
- ENV=test_coverage
install:
- |
if [ "$ENV" = "test" ]; then
pip install pytest
elif [ "$ENV" = "test_coverage" ]; then
sudo add-apt-repository ppa:neovim-ppa/stable -y
sudo apt-get update -q
sudo apt-get install neovim -y
pip install pynvim pytest-cov
pip list
nvim --version
else
vim --version
fi
script:
- make --keep-going "$ENV" BUILD_VIRTUAL_ENV=$VIRTUAL_ENV
after_script:
- |
if [ "$ENV" = "test_coverage" ]; then
coverage xml
travis_retry bash <(curl -s https://codecov.io/bash) -X fix -f coverage.xml -F py${TRAVIS_PYTHON_VERSION//./}
fi

View File

@ -1,61 +0,0 @@
Main Authors
============
David Halter (@davidhalter) <davidhalter88@gmail.com>
Contributors (in order of contributions)
========================================
Patrice Peterson (@runiq)
tek (@tek)
heavenshell (@heavenshell) <heavenshell.jp@gmail.com>
Danilo Bargen (@dbrgn) <gezuru@gmail.com>
mattn (@mattn) <mattn.jp@gmail.com>
Enrico Batista da Luz (@ricobl) <rico.bl@gmail.com>
coot (@coot) <mszamot@gmail.com>
Artur Dryomov (@ming13) <artur.dryomov@gmail.com>
andviro (@andviro)
Jean-Louis Fuchs (@ganwell) <ganwell@fangorn.ch>
Mathieu Comandon (@strycore) <strider@strycore.com>
Nick Hurley (@todesschaf) <hurley@todesschaf.org>
gpoulin (@gpoulin)
Akinori Hattori (@hattya)
Luper Rouch (@flupke)
Matthew Moses (@mlmoses) <moses.matthewl@gmail.com>
Tyler Wymer (@twymer)
Artem Nezvigin (@artnez)
rogererens (@rogererens)
Emily Strickland (@emilyst) <mail@emily.st>
Tin Tvrtković (@Tinche) <tinchester@gmail.com>
Zekeriya Koc (@zekzekus) <zekzekus@gmail.com>
ethinx (@ethinx) <eth2net@gmail.com>
Wouter Overmeire (@lodagro) <lodagro@gmail.com>
Stephen J. Fuhry (@fuhrysteve) <fuhrysteve@gmail.com>
Sheng Yun (@ShengYun) <uewing@gmail.com>
Yann Thomas-Gérard (@inside) <inside@gmail.com>
Colin Su (@littleq0903) <littleq0903@gmail.com>
Arthur Jaron (@eyetracker)
Justin M. Keyes (@justinmk)
nagev (@np1)
Chris Lasher (@gotgenes) <chris.lasher@gmail.com>
Doan Thanh Nam (@tndoan)
Markus Koller (@toupeira)
Justin Cheevers @justincheevers
Talha Ahmed (@talha81) <talha.ahmed@gmail.com>
Matthew Tylee Atkinson (@matatk)
Pedro Ferrari (@petobens)
Daniel Hahler (@blueyed)
Dave Honneffer (@pearofducks)
Bagrat Aznauryan (@n9code)
Tomoyuki Kashiro (@kashiro)
Tommy Allen (@tweekmonster)
Mingliang (@Aulddays)
Brian Mego (@brianmego)
Stevan Milic (@stevanmilic) <stevan.milic@yahoo.com>
Konstantin Glukhov (@Konstantin-Glukhov)
Seungchan An (@SeungChan92) <dev.issea1015@gmail.com>
Thomas Blauth (@ThomasBlauth) <thomas.blauth@protonmail.com>
James Cherti (@jamescherti)
@something are github user names.

View File

@ -1,12 +0,0 @@
# We <3 pull requests!
1. Fork the Repo on github.
2. Add yourself to AUTHORS.txt
3. Add a test if possible.
4. Push to your fork and submit a pull request.
Please use PEP8 as a Python code style. For VIM, just try to style your
code similar to the jedi-vim code that is already there.
# Bug reports
Please include the output of `:version` and `:JediDebugInfo`.

View File

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) <2013> <David Halter and others, see AUTHORS.txt>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -1,35 +0,0 @@
BUILD_VIRTUAL_ENV:=build/venv
test:
pytest
test_nvim:
VSPEC_VIM=nvim pytest
test_coverage: export PYTEST_ADDOPTS:=--cov pythonx --cov test --cov-report=term-missing:skip-covered
test_coverage: test_nvim
$(dir $(BUILD_VIRTUAL_ENV)):
mkdir -p $@
$(BUILD_VIRTUAL_ENV): | $(dir $(BUILD_VIRTUAL_ENV))
python -m venv $@
$(BUILD_VIRTUAL_ENV)/bin/vint: | $(BUILD_VIRTUAL_ENV)
$|/bin/python -m pip install vim-vint==0.3.21
$(BUILD_VIRTUAL_ENV)/bin/flake8: | $(BUILD_VIRTUAL_ENV)
$|/bin/python -m pip install -q flake8==3.7.8
vint: $(BUILD_VIRTUAL_ENV)/bin/vint
$(BUILD_VIRTUAL_ENV)/bin/vint after autoload ftplugin plugin
flake8: $(BUILD_VIRTUAL_ENV)/bin/flake8
$(BUILD_VIRTUAL_ENV)/bin/flake8 pythonx/jedi_*.py
check: vint flake8
clean:
rm -rf build
.PHONY: test check clean vint flake8

View File

@ -1,293 +0,0 @@
.. image:: https://github.com/davidhalter/jedi-vim/blob/master/doc/logotype-a.svg
#################################################
jedi-vim - awesome Python autocompletion with VIM
#################################################
.. image:: https://travis-ci.org/davidhalter/jedi-vim.svg?branch=master
:target: https://travis-ci.org/davidhalter/jedi-vim
:alt: Travis-CI build status
jedi-vim is a VIM binding to the autocompletion library
`Jedi <http://github.com/davidhalter/jedi>`_.
Here are some pictures:
.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_complete.png
Completion for almost anything (Ctrl+Space).
.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_function.png
Display of function/class bodies, docstrings.
.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png
Documentation (Pydoc) support (with highlighting, Shift+k).
There is also support for goto and renaming.
Get the latest from `github <http://github.com/davidhalter/jedi-vim>`_.
Documentation
=============
Documentation is available in your vim: ``:help jedi-vim``. You can also look
it up `on github <http://github.com/davidhalter/jedi-vim/blob/master/doc/jedi-vim.txt>`_.
You can read the Jedi library documentation `here <http://jedi.readthedocs.io/en/latest/>`_.
If you want to report issues, just use the github issue tracker. In case of
questions about the software, please use `stackoverflow
<https://stackoverflow.com/questions/tagged/jedi-vim>`_ and tag your question with ``jedi-vim``.
Contributing
============
We love Pull Requests! Read the instructions in ``CONTRIBUTING.md``.
Features
========
The Jedi library understands most of Python's core features. From decorators to
generators, there is broad support.
Apart from that, jedi-vim supports the following commands
- Completion ``<C-Space>``
- Goto assignment ``<leader>g`` (typical goto function)
- Goto definition ``<leader>d`` (follow identifier as far as possible,
includes imports and statements)
- Goto (typing) stub ``<leader>s``
- Show Documentation/Pydoc ``K`` (shows a popup with assignments)
- Renaming ``<leader>r``
- Usages ``<leader>n`` (shows all the usages of a name)
- Open module, e.g. ``:Pyimport os`` (opens the ``os`` module)
Installation
============
Requirements
------------
You need a VIM version that was compiled 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).
Manual installation
-------------------
You might want to use `pathogen <https://github.com/tpope/vim-pathogen>`_ or
`Vundle <https://github.com/gmarik/vundle>`_ to install jedi-vim.
The first thing you need after that is an up-to-date version of Jedi. Install
``git submodule update --init --recursive`` in your jedi-vim repository.
Example installation command using Pathogen:
.. code-block:: sh
git clone --recursive https://github.com/davidhalter/jedi-vim.git ~/.vim/bundle/jedi-vim
Example installation using Vundle:
Add the following line in your `~/.vimrc`
.. code-block:: vim
Plugin 'davidhalter/jedi-vim'
For installing Jedi, ``pip install jedi`` will also work, but you might run
into issues when working in virtual environments. Please use git submodules.
Installation with your distribution
-----------------------------------
On Arch Linux, you can also install jedi-vim from official repositories as
`vim-jedi <https://www.archlinux.org/packages/community/any/vim-jedi/>`__.
It is also available on
`Debian (≥8) <https://packages.debian.org/vim-python-jedi>`__ and
`Ubuntu (≥14.04) <http://packages.ubuntu.com/vim-python-jedi>`__ as
vim-python-jedi.
On Fedora Linux, it is available as
`vim-jedi <https://apps.fedoraproject.org/packages/vim-jedi>`__.
Please note that this version might be quite old compared to using jedi-vim
from Git.
Caveats
-------
Note that the `python-mode <https://github.com/klen/python-mode>`_ VIM plugin seems
to conflict with jedi-vim, therefore you should disable it before enabling
jedi-vim.
To enjoy the full features of jedi-vim, you should have VIM >= 7.3, compiled with
``+conceal`` (which is not the case on some platforms, including OS X). If your VIM
does not meet these requirements, the parameter recommendation list may not appear
when you type an open bracket after a function name. Please read
`the documentation <http://github.com/davidhalter/jedi-vim/blob/master/doc/jedi-vim.txt>`_
for details.
Settings
========
Jedi is by default automatically initialized. If you don't want that I suggest
you disable the auto-initialization in your ``.vimrc``:
.. code-block:: vim
let g:jedi#auto_initialization = 0
There are also some VIM options (like ``completeopt`` and key defaults) which
are automatically initialized, but you can skip this:
.. code-block:: vim
let g:jedi#auto_vim_configuration = 0
You can make jedi-vim use tabs when going to a definition etc:
.. code-block:: vim
let g:jedi#use_tabs_not_buffers = 1
If you are a person who likes to use VIM-splits, you might want to put this in your ``.vimrc``:
.. code-block:: vim
let g:jedi#use_splits_not_buffers = "left"
This options could be "left", "right", "top", "bottom" or "winwidth". It will decide the direction where the split open.
Jedi automatically starts the completion, if you type a dot, e.g. ``str.``, if
you don't want this:
.. code-block:: vim
let g:jedi#popup_on_dot = 0
Jedi selects the first line of the completion menu: for a better typing-flow
and usually saves one keypress.
.. code-block:: vim
let g:jedi#popup_select_first = 0
Jedi displays function call signatures in insert mode in real-time, highlighting
the current argument. The call signatures can be displayed as a pop-up in the
buffer (set to 1 by default (with the conceal feature), 2 otherwise),
which has the advantage of being easier to refer to (but is a hack with
many drawbacks since it changes the buffer's contents),
or in Vim's command line aligned with the function call (set to 2), which
can improve the integrity of Vim's undo history.
.. code-block:: vim
let g:jedi#show_call_signatures = "1"
Here are a few more defaults for actions, read the docs (``:help jedi-vim``) to
get more information. If you set them to ``""``, they are not assigned.
.. code-block:: vim
NOTE: subject to change!
let g:jedi#goto_command = "<leader>d"
let g:jedi#goto_assignments_command = "<leader>g"
let g:jedi#goto_stubs_command = "<leader>s"
let g:jedi#goto_definitions_command = ""
let g:jedi#documentation_command = "K"
let g:jedi#usages_command = "<leader>n"
let g:jedi#completions_command = "<C-Space>"
let g:jedi#rename_command = "<leader>r"
An example for setting up your project:
.. code-block:: vim
let g:jedi#environment_path = "/usr/bin/python3.9"
jedi-vim tries its best to guess your virtual env. If you want to work with a
specific virtual environment however, you can point jedi-vim towards it:
.. code-block:: vim
let g:jedi#environment_path = "venv"
Finally, if you don't want completion, but all the other features, use:
.. code-block:: vim
let g:jedi#completions_enabled = 0
FAQ
===
I want to use Jedi with a Python 2 Environment, but it's not listed under "Known environments"
----------------------------------------------------------------------------------------------
Starting with version 0.18.0 Jedi dropped support for Python 2.
I don't want the docstring window to popup during completion
------------------------------------------------------------
This depends on the ``completeopt`` option. Jedi initializes it in its
``ftplugin``. Add the following line to your ``.vimrc`` to disable it:
.. code-block:: vim
autocmd FileType python setlocal completeopt-=preview
I want <Tab> to do autocompletion
---------------------------------
Don't even think about changing the Jedi command to ``<Tab>``,
use `supertab <https://github.com/ervandew/supertab>`_!
The completion is too slow!
---------------------------
1. Completion of complex libraries (like Numpy) should only be slow the first
time you complete them. After that the results should be cached and very fast.
2. If it is still slow after the initial completion and you have installed the
python-mode Vim plugin, try disabling its rope mode:
.. code-block:: vim
let g:pymode_rope = 0
See issue `#163 <https://github.com/davidhalter/jedi-vim/issues/163>`__.
3. You can also use `deoplete-jedi <https://github.com/zchee/deoplete-jedi>`__
for completions, which uses Jedi, but does completions asynchronously
(requires Neovim).
It makes sense to use both jedi-vim and deoplete-jedi, but you should disable
jedi-vim's completions then:
.. code-block:: vim
let g:jedi#completions_enabled = 0
Testing
=======
jedi-vim is being tested with a combination of `vspec
<https://github.com/kana/vim-vspec>`_ and `py.test <http://pytest.org/>`_.
The tests are in the ``test`` subdirectory, you can run them calling::
py.test
The tests are automatically run with `travis
<https://travis-ci.org/davidhalter/jedi-vim>`_.

View File

@ -1,3 +0,0 @@
if jedi#init_python() && g:jedi#auto_initialization && g:jedi#completions_enabled
call jedi#setup_completion()
endif

View File

@ -1,34 +0,0 @@
if !jedi#init_python()
finish
endif
if g:jedi#show_call_signatures > 0 && has('conceal')
" +conceal is the default for vim >= 7.3
let s:e = g:jedi#call_signature_escape
let s:full = s:e.'jedi=.\{-}'.s:e.'.\{-}'.s:e.'jedi'.s:e
let s:ignore = s:e.'jedi.\{-}'.s:e
exe 'syn match jediIgnore "'.s:ignore.'" contained conceal'
setlocal conceallevel=2
syn match jediFatSymbol "\*_\*" contained conceal
syn match jediFat "\*_\*.\{-}\*_\*" contained contains=jediFatSymbol
syn match jediSpace "\v[ ]+( )@=" contained
exe 'syn match jediFunction "'.s:full.'" keepend extend '
\ .' contains=jediIgnore,jediFat,jediSpace'
\ .' containedin=pythonComment,pythonString,pythonRawString'
unlet! s:e s:full s:ignore
hi def link jediIgnore Ignore
hi def link jediFatSymbol Ignore
hi def link jediSpace Normal
if exists('g:colors_name')
hi def link jediFunction CursorLine
hi def link jediFat TabLine
else
hi def jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey
hi def jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555
endif
endif
hi def jediUsage cterm=reverse gui=standout

View File

@ -1,4 +0,0 @@
function! health#jedi#check() abort
call health#report_start('jedi')
silent call jedi#debug_info()
endfunction

View File

@ -1,732 +0,0 @@
scriptencoding utf-8
" ------------------------------------------------------------------------
" Settings initialization
" ------------------------------------------------------------------------
let s:deprecations = {
\ 'get_definition_command': 'goto_definitions_command',
\ 'pydoc': 'documentation_command',
\ 'related_names_command': 'usages_command',
\ 'autocompletion_command': 'completions_command',
\ 'show_function_definition': 'show_call_signatures',
\ }
let s:default_settings = {
\ 'use_tabs_not_buffers': 0,
\ 'use_splits_not_buffers': 1,
\ 'auto_initialization': 1,
\ 'auto_vim_configuration': 1,
\ 'goto_command': "'<leader>d'",
\ 'goto_assignments_command': "'<leader>g'",
\ 'goto_definitions_command': "''",
\ 'goto_stubs_command': "'<leader>s'",
\ 'completions_command': "'<C-Space>'",
\ 'call_signatures_command': "'<leader>n'",
\ 'usages_command': "'<leader>n'",
\ 'rename_command': "'<leader>r'",
\ 'completions_enabled': 1,
\ 'popup_on_dot': 'g:jedi#completions_enabled',
\ 'documentation_command': "'K'",
\ 'show_call_signatures': has('conceal') ? 1 : 2,
\ 'show_call_signatures_delay': 500,
\ 'call_signature_escape': "'?!?'",
\ 'auto_close_doc': 1,
\ 'max_doc_height': 30,
\ 'popup_select_first': 1,
\ 'quickfix_window_height': 10,
\ 'force_py_version': "'auto'",
\ 'environment_path': "'auto'",
\ 'added_sys_path': '[]',
\ 'project_path': "'auto'",
\ 'smart_auto_mappings': 0,
\ 'case_insensitive_completion': 1,
\ 'use_tag_stack': 1
\ }
for [s:key, s:val] in items(s:deprecations)
if exists('g:jedi#'.s:key)
echom "'g:jedi#".s:key."' is deprecated. Please use 'g:jedi#".s:val."' instead. Sorry for the inconvenience."
exe 'let g:jedi#'.s:val.' = g:jedi#'.s:key
endif
endfor
for [s:key, s:val] in items(s:default_settings)
if !exists('g:jedi#'.s:key)
exe 'let g:jedi#'.s:key.' = '.s:val
endif
endfor
let s:supports_buffer_usages = has('nvim') || exists('*prop_add')
" ------------------------------------------------------------------------
" Python initialization
" ------------------------------------------------------------------------
let s:script_path = expand('<sfile>:p:h:h')
function! s:init_python() abort
" Use g:jedi#force_py_version for loading Jedi, or fall back to using
" `has()` - preferring Python 3.
if !has('python3')
throw 'jedi-vim requires Vim with support for Python 3.'
endif
call jedi#setup_python_imports()
return 1
endfunction
function! jedi#reinit_python() abort
let s:_init_python = -1
call jedi#init_python()
endfunction
" This is meant to be called with `:unsilent` (for &shortmess+=F).
function! s:display_exception() abort
let error_lines = split(v:exception, '\n')
let msg = 'Error: jedi-vim failed to initialize Python: '
\ .error_lines[0].' (in '.v:throwpoint.')'
if len(error_lines) > 1
echohl ErrorMsg
echom 'jedi-vim error: '.error_lines[0]
for line in error_lines[1:]
echom line
endfor
echohl None
let help_cmd = ':JediDebugInfo'
if exists(':checkhealth') == 2
let help_cmd .= ' / :checkhealth'
endif
let msg .= printf('. See :messages and/or %s for more information.',
\ help_cmd)
endif
redraw " Redraw to only have the main message by default.
echoerr msg
endfunction
let s:_init_python = -1
function! jedi#init_python() abort
if s:_init_python == -1
let s:_init_python = 0
try
let s:_init_python = s:init_python()
let s:_init_python = 1
catch /^jedi/
" Only catch errors from jedi-vim itself here, so that for
" unexpected Python exceptions the traceback will be shown
" (e.g. with NameError in jedi#setup_python_imports's code).
if !exists('g:jedi#squelch_py_warning')
unsilent call s:display_exception()
endif
endtry
endif
return s:_init_python
endfunction
function! jedi#setup_python_imports() abort
let g:_jedi_init_error = 0
let init_lines = [
\ 'import vim',
\ 'def _jedi_handle_exc(exc_info):',
\ ' try:',
\ ' from jedi_vim_debug import format_exc_info',
\ ' vim.vars["_jedi_init_error"] = format_exc_info(exc_info)',
\ ' except Exception:',
\ ' import traceback',
\ ' vim.vars["_jedi_init_error"] = "\\n".join(traceback.format_exception(*exc_info))',
\ 'try:',
\ ' import jedi_vim',
\ ' if hasattr(jedi_vim, "jedi_import_error"):',
\ ' _jedi_handle_exc(jedi_vim.jedi_import_error)',
\ 'except Exception as exc:',
\ ' _jedi_handle_exc(sys.exc_info())',
\ ]
exe 'python3 exec('''.escape(join(init_lines, '\n'), "'").''')'
if g:_jedi_init_error isnot 0
throw printf('jedi#setup_python_imports: %s', g:_jedi_init_error)
endif
return 1
endfunction
function! jedi#debug_info() abort
if &verbose
if &filetype !=# 'python'
echohl WarningMsg | echo 'You should run this in a buffer with filetype "python".' | echohl None
endif
endif
let spath = shellescape(s:script_path)
echo '#### Jedi-vim debug information'
echo "\n"
echo '##### jedi-vim version'
echo "\n"
echo ' - jedi-vim git version: '
echon substitute(system('git -C '.spath.' describe --tags --always --dirty'), '\v\n$', '', '')
echo ' - jedi git submodule status: '
echon substitute(system('git -C '.spath.' submodule status pythonx/jedi'), '\v\n$', '', '')
echo ' - parso git submodule status: '
echon substitute(system('git -C '.spath.' submodule status pythonx/parso'), '\v\n$', '', '')
echo "\n"
echo '##### Global Python'
echo "\n"
echo 'Using Python version 3 to access Jedi.'
let s:pythonjedi_called = 0
try
python3 import vim; vim.command('let s:pythonjedi_called = 1')
catch
echo 'Error when trying to import vim: '.v:exception
endtry
if !s:pythonjedi_called
echohl WarningMsg
echom 'python3 failed to run, likely a Python config issue.'
if exists(':checkhealth') == 2
echom 'Try :checkhealth for more information.'
endif
echohl None
else
try
python3 from jedi_vim_debug import display_debug_info
python3 display_debug_info()
catch
echohl WarningMsg
echo 'Error when running display_debug_info: '.v:exception
echohl None
endtry
endif
echo "\n"
echo '##### Settings'
echo "\n"
echo '```'
let jedi_settings = items(filter(copy(g:), "v:key =~# '\\v^jedi#'"))
let has_nondefault_settings = 0
for [k, V] in jedi_settings
exe 'let default = '.get(s:default_settings,
\ substitute(k, '\v^jedi#', '', ''), "'-'")
" vint: -ProhibitUsingUndeclaredVariable
if default !=# V
echo printf('g:%s = %s (default: %s)', k, string(V), string(default))
unlet! V " Fix variable type mismatch with Vim 7.3.
let has_nondefault_settings = 1
endif
" vint: +ProhibitUsingUndeclaredVariable
endfor
if has_nondefault_settings
echo "\n"
endif
verb set omnifunc? completeopt?
echo '```'
if &verbose
echo "\n"
echo '#### :version'
echo '```'
version
echo '```'
echo "\n"
echo '#### :messages'
echo '```'
messages
echo '```'
echo "\n"
echo '<details><summary>:scriptnames</summary>'
echo "\n"
echo '```'
scriptnames
echo '```'
echo '</details>'
endif
endfunction
" Helper function instead of `python vim.eval()`, and `.command()` because
" these also return error definitions.
function! jedi#_vim_exceptions(str, is_eval) abort
let l:result = {}
try
if a:is_eval
let l:result.result = eval(a:str)
else
execute a:str
let l:result.result = ''
endif
catch
let l:result.exception = v:exception
let l:result.throwpoint = v:throwpoint
endtry
return l:result
endfunction
call jedi#init_python() " Might throw an error.
" ------------------------------------------------------------------------
" functions that call python code
" ------------------------------------------------------------------------
function! jedi#goto() abort
python3 jedi_vim.goto(mode="goto")
endfunction
function! jedi#goto_assignments() abort
python3 jedi_vim.goto(mode="assignment")
endfunction
function! jedi#goto_definitions() abort
python3 jedi_vim.goto(mode="definition")
endfunction
function! jedi#goto_stubs() abort
python3 jedi_vim.goto(mode="stubs")
endfunction
function! jedi#usages() abort
if exists('#jedi_usages#BufWinEnter')
call jedi#clear_usages()
endif
python3 jedi_vim.usages()
endfunction
if !s:supports_buffer_usages
" Hide usages in the current window.
" Only handles the current window due to matchdelete() restrictions.
function! jedi#_hide_usages_in_win() abort
let winnr = winnr()
let matchids = getwinvar(winnr, '_jedi_usages_vim_matchids', [])
for matchid in matchids[1:]
call matchdelete(matchid)
endfor
call setwinvar(winnr, '_jedi_usages_vim_matchids', [])
" Remove the autocommands that might have triggered this function.
augroup jedi_usages
exe 'autocmd! * <buffer='.winbufnr(winnr).'>'
augroup END
unlet! b:_jedi_usages_needs_clear
endfunction
" Show usages for current window (Vim without textprops only).
function! jedi#_show_usages_in_win() abort
python3 jedi_vim.highlight_usages_for_vim_win()
if !exists('#jedi_usages#TextChanged#<buffer>')
augroup jedi_usages
" Unset highlights on any changes to this buffer.
" NOTE: Neovim's API handles movement of highlights, but would only
" need to clear highlights that are changed inline.
autocmd TextChanged <buffer> call jedi#_clear_buffer_usages()
" Hide usages when the buffer is removed from the window, or when
" entering insert mode (but keep them for later).
autocmd BufWinLeave,InsertEnter <buffer> call jedi#_hide_usages_in_win()
augroup END
endif
endfunction
" Remove usages for the current buffer (and all its windows).
function! jedi#_clear_buffer_usages() abort
let bufnr = bufnr('%')
let nvim_src_ids = getbufvar(bufnr, '_jedi_usages_src_ids', [])
if !empty(nvim_src_ids)
for src_id in nvim_src_ids
" TODO: could only clear highlights below/after changed line?!
call nvim_buf_clear_highlight(bufnr, src_id, 0, -1)
endfor
else
call jedi#_hide_usages_in_win()
endif
endfunction
endif
" Remove/unset global usages.
function! jedi#clear_usages() abort
augroup jedi_usages
autocmd! BufWinEnter
autocmd! WinEnter
augroup END
if !s:supports_buffer_usages
" Vim without textprops: clear current window,
" autocommands will clean others on demand.
call jedi#_hide_usages_in_win()
" Setup autocommands to clear remaining highlights on WinEnter.
augroup jedi_usages
for b in range(1, bufnr('$'))
if getbufvar(b, '_jedi_usages_needs_clear')
exe 'autocmd WinEnter <buffer='.b.'> call jedi#_hide_usages_in_win()'
endif
endfor
augroup END
endif
python3 jedi_vim.clear_usages()
endfunction
function! jedi#rename(...) abort
python3 jedi_vim.rename()
endfunction
function! jedi#rename_visual(...) abort
python3 jedi_vim.rename_visual()
endfunction
function! jedi#completions(findstart, base) abort
python3 jedi_vim.completions()
endfunction
function! jedi#enable_speed_debugging() abort
python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
endfunction
function! jedi#enable_debugging() abort
python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
endfunction
function! jedi#disable_debugging() abort
python3 jedi_vim.jedi.set_debug_function(None)
endfunction
function! jedi#py_import(args) abort
python3 jedi_vim.py_import()
endfun
function! jedi#choose_environment(args) abort
python3 jedi_vim.choose_environment()
endfun
function! jedi#load_project(args) abort
python3 jedi_vim.load_project()
endfun
function! jedi#py_import_completions(argl, cmdl, pos) abort
python3 jedi_vim.py_import_completions()
endfun
function! jedi#clear_cache(bang) abort
if a:bang
python3 jedi_vim.jedi.cache.clear_time_caches(True)
else
python3 jedi_vim.jedi.cache.clear_time_caches(False)
endif
endfunction
" ------------------------------------------------------------------------
" show_documentation
" ------------------------------------------------------------------------
function! jedi#show_documentation() abort
python3 if jedi_vim.show_documentation() is None: vim.command('return')
let bn = bufnr('__doc__')
if bn > 0
let wi=index(tabpagebuflist(tabpagenr()), bn)
if wi >= 0
" If the __doc__ buffer is open in the current tab, jump to it
silent execute (wi+1).'wincmd w'
else
silent execute 'sbuffer '.bn
endif
else
split __doc__
endif
setlocal modifiable
setlocal noswapfile
setlocal buftype=nofile
silent normal! ggdG
silent $put=l:doc
silent normal! 1Gdd
setlocal nomodifiable
setlocal nomodified
setlocal filetype=rst
setlocal foldlevel=200 " do not fold in __doc__
if l:doc_lines > g:jedi#max_doc_height " max lines for plugin
let l:doc_lines = g:jedi#max_doc_height
endif
execute 'resize '.l:doc_lines
" quit comands
nnoremap <buffer> q ZQ
if len(g:jedi#documentation_command)
execute 'nnoremap <buffer> '.g:jedi#documentation_command.' ZQ'
endif
endfunction
" ------------------------------------------------------------------------
" helper functions
" ------------------------------------------------------------------------
function! jedi#add_goto_window(for_usages, len) abort
let height = min([a:len, g:jedi#quickfix_window_height])
" Use :copen to go to the window always - the user should select an entry.
execute 'belowright copen '.height
if &filetype !=# 'qf'
echoerr printf('jedi-vim: unexpected ft with current window (%s), please report!', &filetype)
endif
if g:jedi#use_tabs_not_buffers == 1
noremap <buffer> <CR> :call jedi#goto_window_on_enter()<CR>
endif
augroup jedi_goto_window
if a:for_usages
autocmd BufWinLeave <buffer> call jedi#clear_usages()
else
autocmd WinLeave <buffer> q " automatically leave, if an option is chosen
endif
augroup END
if a:for_usages && !has('nvim')
if s:supports_buffer_usages
" Setup autocommand for pending highlights with Vim's textprops.
" (cannot be added to unlisted buffers)
augroup jedi_usages
autocmd! BufWinEnter * call s:usages_for_pending_buffers()
augroup END
else
" Setup global autocommand to display any usages for a window.
" Gets removed when closing the quickfix window that displays them, or
" when clearing them (e.g. on TextChanged).
augroup jedi_usages
autocmd! BufWinEnter,WinEnter * call jedi#_show_usages_in_win()
augroup END
endif
endif
endfunction
" Highlight usages for a buffer if not done so yet (Neovim only).
function! s:usages_for_pending_buffers() abort
python3 jedi_vim._handle_pending_usages_for_buf()
endfunction
function! jedi#goto_window_on_enter() abort
let l:list = getqflist()
let l:data = l:list[line('.') - 1]
if l:data.bufnr
" close goto_window buffer
normal! ZQ
python3 jedi_vim.set_buffer(vim.eval('bufname(l:data.bufnr)'))
call cursor(l:data.lnum, l:data.col)
else
echohl WarningMsg | echo 'Builtin module cannot be opened.' | echohl None
endif
endfunction
function! s:syn_stack() abort
if !exists('*synstack')
return []
endif
return map(synstack(line('.'), col('.') - 1), "synIDattr(v:val, 'name')")
endfunc
function! jedi#do_popup_on_dot_in_highlight() abort
let highlight_groups = s:syn_stack()
for a in highlight_groups
if a ==# 'pythonDoctest'
return 1
endif
endfor
for a in highlight_groups
for b in ['pythonString', 'pythonComment', 'pythonNumber']
if a == b
return 0
endif
endfor
endfor
return 1
endfunc
let s:show_call_signatures_last = [0, 0, '']
function! jedi#show_call_signatures() abort
if s:_init_python == 0
return 1
endif
let [line, col] = [line('.'), col('.')]
let curline = getline(line)
let reload_signatures = 1
" Caching. On the same line only.
if line == s:show_call_signatures_last[0]
" Check if the number of special signs before or after the
" cursor has not changed since the last call, which means that the
" argument position was not changed and we can skip repainting.
let prevcol = s:show_call_signatures_last[1]
let prevline = s:show_call_signatures_last[2]
let no_special = '[^,()=]'
if substitute(curline[:col-2], no_special, '', 'g')
\ == substitute(prevline[:prevcol-2], no_special, '', 'g')
\ && substitute(curline[(col-2):], no_special, '', 'g')
\ == substitute(prevline[(prevcol-2):], no_special, '', 'g')
let reload_signatures = 0
endif
endif
let s:show_call_signatures_last = [line, col, curline]
if reload_signatures
python3 jedi_vim.show_call_signatures()
endif
endfunction
function! jedi#clear_call_signatures() abort
if s:_init_python == 0
return 1
endif
let s:show_call_signatures_last = [0, 0, '']
python3 jedi_vim.clear_call_signatures()
endfunction
function! jedi#configure_call_signatures() abort
augroup jedi_call_signatures
autocmd! * <buffer>
if g:jedi#show_call_signatures == 2 " Command line call signatures
autocmd InsertEnter <buffer> let g:jedi#first_col = s:save_first_col()
endif
autocmd InsertEnter <buffer> let s:show_call_signatures_last = [0, 0, '']
autocmd InsertLeave <buffer> call jedi#clear_call_signatures()
if g:jedi#show_call_signatures_delay > 0
autocmd InsertEnter <buffer> let b:_jedi_orig_updatetime = &updatetime
\ | let &updatetime = g:jedi#show_call_signatures_delay
autocmd InsertLeave <buffer> if exists('b:_jedi_orig_updatetime')
\ | let &updatetime = b:_jedi_orig_updatetime
\ | unlet b:_jedi_orig_updatetime
\ | endif
autocmd CursorHoldI <buffer> call jedi#show_call_signatures()
else
autocmd CursorMovedI <buffer> call jedi#show_call_signatures()
endif
augroup END
endfunction
" Determine where the current window is on the screen for displaying call
" signatures in the correct column.
function! s:save_first_col() abort
if bufname('%') ==# '[Command Line]' || winnr('$') == 1
return 0
endif
let startwin = winnr()
let winwidth = winwidth(0)
if winwidth == &columns
return 0
elseif winnr('$') == 2
return startwin == 1 ? 0 : (winwidth(1) + 1)
elseif winnr('$') == 3
if startwin == 1
return 0
endif
let ww1 = winwidth(1)
let ww2 = winwidth(2)
let ww3 = winwidth(3)
if ww1 + ww2 + ww3 + 2 == &columns
if startwin == 2
return ww1 + 1
else
return ww1 + ww2 + 2
endif
elseif startwin == 2
if ww2 + ww3 + 1 == &columns
return 0
else
return ww1 + 1
endif
else " startwin == 3
if ww2 + ww3 + 1 == &columns
return ww2 + 1
else
return ww1 + 1
endif
endif
endif
return 0
endfunction
function! jedi#complete_string(autocomplete) abort
if a:autocomplete
if !(g:jedi#popup_on_dot && jedi#do_popup_on_dot_in_highlight())
return ''
endif
let s:saved_completeopt = &completeopt
set completeopt-=longest
set completeopt+=menuone
set completeopt-=menu
if &completeopt !~# 'noinsert\|noselect'
" Patch 775 introduced noinsert and noselect, previously these
" options didn't exist. Setting them in earlier versions results in
" errors (E474).
if has('patch-7.4-775')
if g:jedi#popup_select_first
set completeopt+=noinsert
else
set completeopt+=noselect
endif
else
" To pass the tests we use this, it seems to get the closest to
" the other options. I'm really not sure if this properly
" works, but VIM 7.4-775 is already pretty old, so it might not
" be a problem anymore in a few years.
set completeopt+=longest
endif
endif
elseif pumvisible()
return "\<C-n>"
endif
return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened(".a:autocomplete.")\<CR>"
endfunction
function! jedi#complete_opened(autocomplete) abort
if a:autocomplete
let &completeopt = s:saved_completeopt
unlet s:saved_completeopt
elseif pumvisible() && g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1
return "\<Down>"
endif
return ''
endfunction
function! jedi#smart_auto_mappings() abort
" Auto put import statement after from module.name<space> and complete
if search('\m^\s*from\s\+[A-Za-z0-9._]\{1,50}\%#\s*$', 'bcn', line('.'))
" Enter character and start completion.
return "\<space>import \<C-r>=jedi#complete_string(1)\<CR>"
endif
return "\<space>"
endfunction
function! jedi#setup_completion() abort
" We need our own omnifunc, so this overrides the omnifunc set by
" $VIMRUNTIME/ftplugin/python.vim.
setlocal omnifunc=jedi#completions
" map ctrl+space for autocompletion
if g:jedi#completions_command ==# '<C-Space>'
" In terminals, <C-Space> sometimes equals <Nul>.
imap <buffer> <Nul> <C-Space>
smap <buffer> <Nul> <C-Space>
endif
if len(g:jedi#completions_command)
execute 'inoremap <expr> <buffer> '.g:jedi#completions_command.' jedi#complete_string(0)'
" A separate mapping for select mode: deletes and completes.
execute 'snoremap <expr> <buffer> '.g:jedi#completions_command." '\<C-g>c'.jedi#complete_string(0)"
endif
endfunction
"python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
"python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
" vim: set et ts=4:

View File

@ -1,7 +0,0 @@
coverage:
status:
project: true
patch: true
changes: true
comment: off

View File

@ -1,578 +0,0 @@
*jedi-vim.txt* - For Vim version 7.3 - Last change: 2014/07/29
__ _______ _______ __ ____ ____ __ .___ ___.~
| | | ____|| \ | | \ \ / / | | | \/ |~
| | | |__ | .--. || | _____\ \/ / | | | \ / |~
.--. | | | __| | | | || | |______\ / | | | |\/| |~
| `--' | | |____ | '--' || | \ / | | | | | |~
\______/ |_______||_______/ |__| \__/ |__| |__| |__|~
jedi-vim - awesome Python autocompletion with Vim
==============================================================================
Contents *jedi-vim-contents*
1. Introduction |jedi-vim-introduction|
2. Installation |jedi-vim-installation|
2.0. Requirements |jedi-vim-installation-requirements|
2.1. Manually |jedi-vim-installation-manually|
2.2. Using Pathogen |jedi-vim-installation-pathogen|
2.3. Using Vundle |jedi-vim-installation-vundle|
2.4. Installing from Repositories |jedi-vim-installation-repos|
3. Supported Python features |jedi-vim-support|
4. Usage |jedi-vim-usage|
5. Mappings |jedi-vim-keybindings|
5.1. Start completion |g:jedi#completions_command|
5.2. Go to definition |g:jedi#goto_command|
5.3. Go to assignment |g:jedi#goto_assignments_command|
5.4 Go to stub |g:jedi#goto_stubs_command|
5.5. Show documentation |g:jedi#documentation_command|
5.6. Rename variables |g:jedi#rename_command|
5.7. Show name usages |g:jedi#usages_command|
5.8. Open module by name |:Pyimport|
6. Configuration |jedi-vim-configuration|
6.1. auto_initialization |g:jedi#auto_initialization|
6.2. auto_vim_configuration |g:jedi#auto_vim_configuration|
6.3. popup_on_dot |g:jedi#popup_on_dot|
6.4. popup_select_first |g:jedi#popup_select_first|
6.5. auto_close_doc |g:jedi#auto_close_doc|
6.6. show_call_signatures |g:jedi#show_call_signatures|
6.7. show_call_signatures_delay |g:jedi#show_call_signatures_delay|
6.8. use_tabs_not_buffers |g:jedi#use_tabs_not_buffers|
6.9. squelch_py_warning |g:jedi#squelch_py_warning|
6.10. completions_enabled |g:jedi#completions_enabled|
6.11. use_splits_not_buffers |g:jedi#use_splits_not_buffers|
6.12. force_py_version |g:jedi#force_py_version|
6.13. smart_auto_mappings |g:jedi#smart_auto_mappings|
6.14. use_tag_stack |g:jedi#use_tag_stack|
6.15. environment_path |g:jedi#environment_path|
|b:jedi_environment_path|
6.16. added_sys_path |g:jedi#added_sys_path|
|b:jedi_added_sys_path|
6.17. case_insensitive_completion |g:jedi#case_insensitive_completion|
|b:jedi_case_insensitive_completion|
7. Testing |jedi-vim-testing|
8. Contributing |jedi-vim-contributing|
9. License |jedi-vim-license|
==============================================================================
1. Introduction *jedi-vim-introduction*
Jedi-vim is a Vim binding to the awesome Python autocompletion library
`jedi`. Among jedi's (and, therefore, jedi-vim's) features are:
- Completion for a wide array of Python features (see |jedi-vim-support|)
- Robust in dealing with syntax errors and wrong indentation
- Parses complex module/function/class structures
- Infers function arguments from Sphinx/Epydoc strings
- Doesn't execute Python code
- Supports Virtualenv
- Supports Python 2.7 and 3.4+
By leveraging this library, jedi-vim adds the following capabilities to Vim:
- Displaying function/class bodies
- "Go to definition" command
- Displaying docstrings
- Renaming and refactoring
- Looking up related names
==============================================================================
2. Installation *jedi-vim-installation*
------------------------------------------------------------------------------
2.0. Requirements *jedi-vim-installation-requirements*
First of all, jedi-vim requires Vim to be compiled with the `+python` option.
It is best if you have VIM >= 7.3, compiled with the `+conceal` option. With
older versions, you will probably not see the parameter recommendation list
for functions after typing the open bracket. Some platforms (including OS X
releases) do not ship a VIM with `+conceal`. You can check if your VIM has the
feature with >
:ver
and look for "`+conceal`" (as opposed to "`-conceal`") or >
:echo has('conceal')
which will report 0 (not included) or 1 (included). If your VIM lacks this
feature and you would like function parameter completion, you will need to
build your own VIM, or use a package for your operating system that has this
feature (such as MacVim on OS X, which also contains a console binary).
------------------------------------------------------------------------------
2.1. Installing manually *jedi-vim-installation-manually*
1. If you want to install jedi as a submodule instead, issue this command: >
git clone --recursive http://github.com/davidhalter/jedi-vim
2. Put the plugin files into their respective folders in your vim runtime
directory (usually ~/.vim). Be sure to pay attention to the directory
structure!
3. Update the Vim help tags with >
:helptags <path/to/vimruntime>/doc
------------------------------------------------------------------------------
2.2. Installing using Pathogen *jedi-vim-installation-pathogen*
Pathogen simplifies installation considerably.
1.a Clone the git repository into your bundles directory: >
git clone http://github.com/davidhalter/jedi-vim path/to/bundles/jedi-vim
1b. Again, if you want to install jedi as a submodule, use this command
instead: >
git clone --recursive http://github.com/davidhalter/jedi-vim
------------------------------------------------------------------------------
2.3. Installing using Vundle *jedi-vim-installation-vundle*
1. Vundle automatically downloads subrepositories as git submodules, so you
will automatically get the jedi library with the jedi-vim plugin. Add the
following to the Bundles section in your .vimrc file: >
Plugin 'davidhalter/jedi-vim'
2. Issue the following command in Vim: >
:PluginInstall
Help tags are generated automatically, so you should be good to go.
------------------------------------------------------------------------------
2.4. Installing from Repositories *jedi-vim-installation-repos*
Some Linux distributions have jedi-vim packages in their official
repositories. On Arch Linux, install vim-jedi. On Debian (8+) or Ubuntu
(14.04+) install vim-python-jedi.
==============================================================================
3. Supported Python features *jedi-vim-support*
The Jedi library does all the hard work behind the scenes. It understands most
Python features, among them:
- Builtins
- Multiple `return`s or `yield`s
- Tuple assignments/array indexing/dictionary indexing
- `with`-statement/exception handling
- `*args` and `**kwargs`
- Decorators, lambdas, closures
- Generators, iterators
- Some descriptors: `property`/`staticmethod`/`classmethod`
- Some magic methods: `__call__`, `__iter__`, `__next__`, `__get__`,
`__getitem__`, `__init__`
- `list.append()`, `set.add()`, `list.extend()`, etc.
- (Nested) list comprehensions and ternary expressions
- Relative `import`s
- `getattr()`/`__getattr__`/`__getattribute__`
- Function annotations (py3k feature, are being ignored at the moment, but are
parsed)
- Class decorators (py3k feature, are being ignored at the moment, but are
parsed)
- Simple/usual `sys.path` modifications
- `isinstance` checks for `if`/`while`/`assert` case, that doesn't work with
Jedi
- Stubs
- And more...
Note: This list is not necessarily up to date. For a complete list of
features, please refer to the Jedi documentation at
http://jedi.readthedocs.io.
==============================================================================
4. Usage *jedi-vim-usage*
With the default settings, autocompletion can be triggered by typing
<Ctrl-Space>. The first entry will automatically be selected, so you can press
<Return> to insert it into your code or keep typing and narrow down your
completion options. The usual <C-X><C-O> and <C-P>/<C-N> keybindings work as
well. Autocompletion is also triggered by typing a period in insert mode.
Since periods rarely occur in Python code outside of method/import lookups,
this is handy to have (but can be disabled).
When it encounters a new module, jedi might take a few seconds to parse that