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.
item | version |
---|---|
OS | OS X Yosemite |
Python | Python2.7.10 |
neovim | NVIM 0.1.4 |
I wrote the setting of jedi-vim in dein_lazy.toml referring to plugin management of vim with dein.vim.
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.
The inside of the red frame is a pop-up.
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.
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 ↓
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.
[vim] How to make the python completion plugin "jedi-vim" comfortable (jedi-vim + neocomplete)
Recommended Posts