30 April 2023

How to install jedi-vim for Python automatic code completion?

 

 

Step 1. Install Pathogen vim plug-in manager

https://github.com/tpope/vim-pathogen 

Installation

Install to ~/.vim/autoload/pathogen.vim. Or copy and paste the following into your terminal/shell:

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

(If you're using Windows, change all occurrences of ~/.vim to ~\vimfiles.)

Runtime Path Manipulation

Add this to your vimrc:

execute pathogen#infect()

If you're brand new to Vim and lacking a vimrc, vim ~/.vimrc and paste in the following super-minimal example:

execute pathogen#infect()
syntax on
filetype plugin indent on

Now any plugins you wish to install can be extracted to a subdirectory under ~/.vim/bundle, and they will be added to the 'runtimepath'. Observe:

cd ~/.vim/bundle && \
git clone https://github.com/tpope/vim-sensible.git

Now sensible.vim is installed.

 


Step 2. Install jedi-vim plug-in


Installation

Requirements

You need a VIM version that was compiled with Python 3 or later (+python3). You can check this from within VIM using :python3 import sys; print(sys.version).

Manual installation

You might want to use pathogen 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:

git clone --recursive https://github.com/davidhalter/jedi-vim.git ~/.vim/bundle/jedi-vim 

No comments:

Post a Comment