[Python environment maintenance] De-NeoBundle. Prepare the environment of the super convenient complementary plug-in jedi-vim with dein and set it to be comfortable

There are many articles about the settings of jedi-vim, but since all the articles were about the settings combined with NeoBundle and neocomplete, I will write the dein.vim version.

Overview

environment

item version
OS OS X Yosemite
Python Python2.7.10
neovim NVIM 0.1.4

Introduced jedi-vim

I wrote the setting of jedi-vim in dein_lazy.toml referring to plugin management of vim with dein.vim.

Minimal settings

If you prefer the minimum settings, please copy and paste this setting. As you can see in the overview, if you want to get rid of pop-ups and auto-completion, just look at it. It's a bit of a chat, but I'm having a problem because the settings are not reflected even if I rewrite the configuration file after installing the plugin. I would appreciate it if anyone could tell me. Currently, every time the plugin settings are rewritten, the plugin itself is erased and reinstalled (; _;)

dein_lazy.toml


[[plugins]]
repo = 'davidhalter/jedi-vim'
on_ft = 'python'

After writing this setting, open hogehoge.py with neovim and you should start installing jedi-vim. If help is displayed properly with: h jedi, it means that the installation is complete. I think this setting is convenient enough. However, there are cases where it feels a little inconvenient, so I will explain it with a simple code.

test.py


import pandas as pd

list. #I'm glad that candidates for this complement will come out soon

pd. #With pandas etc., it takes a lot of time to present complementary candidates and it is stressful

Since there are many cases where Pandas is used, I wanted to do something about it, so I wanted to start completion at my own timing instead of automatically. Also, with the minimum settings, every time you move a completion candidate, the description (English) of that candidate is displayed in the upper half of the screen. To be honest, I thought I wouldn't see it, so I'd like to erase this as well. After the minimum setting, it will look like this. min_qiita.png

The inside of the red frame is a pop-up.

pd_qiita.png

Completion such as numpy also takes quite a bit. pandas [B] is a candidate for completion by deoplete. The existing words appear as candidates in the file.

No pop-up. No auto-completion settings

Original repository davidhalter / jedi-vim I tried to set it referring to the README.

dein_lazy.toml


[[plugins]]
repo = 'davidhalter/jedi-vim'
on_ft = 'python'
hook_add = '''
  let g:jedi#use_tabs_not_buffers = 1 #I intended to use tab when advancing to the next candidate by completion, but I could not.
  let g:jedi#popup_select_first = 0 #Cancel the setting that the first candidate is input
  let g:jedi#popup_on_dot = 0 # .Cancel the setting that completion starts when you enter
  let g:jedi#goto_command = "<leader>d"
  let g:jedi#goto_assignments_command = "<leader>g"
  let g:jedi#goto_definitions_command = ""
  let g:jedi#documentation_command = "K"
  let g:jedi#usages_command = "<leader>n"
  let g:jedi#rename_command = "<leader>R" #quick-Change to uppercase R to avoid conflicting with run.README<leader>r
  autocmd FileType python setlocal completeopt-=preview #Don't show pop-up
'''

After writing this setting, open the appropriate python file and the installation should start. When you enter \ <C + Space > (control + space) at the timing you want to complete, completion candidates are displayed. The pop-up should also disappear.

↓ Like this ↓ スクリーンショット 2016-07-15 16.20.03.png

After entering pd.rea and pressing \ <C + Space >, this is the image. There was no pop-up, and I didn't have to wait too long because the number of candidates was decreasing by hitting halfway.

When I was using normal Vim, I set it to the minimum, and it was a pain to wait for pd. Every time, but I'm glad I was able to solve it this time. If you are using jedi-vim and are having trouble with auto-completion, or if you are having trouble with the edit screen rattling due to a pop-up that you do not read, please try it.

reference

Vim plugin management with dein.vim

davidhalter/jedi-vim

[vim] How to make the python completion plugin "jedi-vim" comfortable (jedi-vim + neocomplete)

Recommended Posts

[Python environment maintenance] De-NeoBundle. Prepare the environment of the super convenient complementary plug-in jedi-vim with dein and set it to be comfortable
I set the environment variable with Docker and displayed it in Python
Prepare the execution environment of Python3 with Docker
Return the image data with Flask of Python and draw it to the canvas element of HTML
Overview of Python virtual environment and how to create it
Process the gzip file UNLOADed with Redshift with Python of Lambda, gzip it again and upload it to S3
Find the white Christmas rate by prefecture with Python and map it to a map of Japan
Convert the result of python optparse to dict and utilize it
Read the data of the NFC reader connected to Raspberry Pi 3 with Python and send it to openFrameworks with OSC
[Python] Wouldn't it be the best and highest if you could grasp the characteristics of a company with nlplot?
Prepare a development environment that is portable and easy to duplicate without polluting the environment with Python embeddable (Windows)
GAE --With Python, rotate the image based on the rotation information of EXIF and upload it to Cloud Storage.
Specify the start and end positions of files to be included with qiitap
Build a python environment to learn the theory and implementation of deep learning
Introduction to Python Let's prepare the development environment
Note: Prepare the environment of CmdStanPy with docker
Extract images and tables from pdf with python to reduce the burden of reporting
I tried to automate the article update of Livedoor blog with Python and selenium.
Make it easy to install the ROS2 development environment with pip install on Python venv
How to set the development environment for each project with VSCode + Python extension + Miniconda
I tried to compare the processing speed with dplyr of R and pandas of Python
It is easy to execute SQL with Python and output the result in Excel
I don't like to be frustrated with the release of Pokemon Go, so I made a script to detect the release and tweet it
Visualize the range of interpolation and extrapolation with python
Install Ubuntu 20.04 with GUI and prepare the development environment
I tried to get the number of days of the month holidays (Saturdays, Sundays, and holidays) with python
Recursively get the Excel list in a specific folder with python and write it to Excel.
[Super easy! ] How to display the contents of dictionaries and lists including Japanese in Python
[Python] A program to find the number of apples and oranges that can be harvested
How to prepare the execution environment of the ultra-lightweight Python "Python embeddable" (about 15MB) Memo (until the introduction of pip and other libraries (eg psutil))