View on GitHub

memo

jedi-vim

jedi-vim

jedi-vim is a VIM binding to the autocompletion library Jedi.

Installation

vim上で以下のcommandで対応しているか確認できる。

:python3 import sys; print(sys.version)
:python import sys; print(sys.version)
pip install jedi

Configuraition

bufferではなくtabで定義に移動

let g:jedi#use_tabs_not_buffers = 1

bufferではなくvsで定義を表示

let g:jedi#use_splits_not_buffers = "left"

dot.を押すとdefaultでcompletionされるが、offにできる。

let g:jedi#popup_on_dot = 0

defaultのkey assign

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#completions_command = "<C-Space>"
let g:jedi#rename_command = "<leader>r"

completionが不要の場合

" disable completion
let g:jedi#completions_enabled = 0

Keybinding

Python keybinding

Reference