jedi.vim 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. if !jedi#init_python()
  2. finish
  3. endif
  4. " ------------------------------------------------------------------------
  5. " Initialization of jedi-vim
  6. " ------------------------------------------------------------------------
  7. if g:jedi#auto_initialization
  8. " goto / get_definition / usages
  9. if g:jedi#goto_assignments_command != ''
  10. execute "nnoremap <buffer> ".g:jedi#goto_assignments_command." :call jedi#goto_assignments()<CR>"
  11. endif
  12. if g:jedi#goto_definitions_command != ''
  13. execute "nnoremap <buffer> ".g:jedi#goto_definitions_command." :call jedi#goto_definitions()<CR>"
  14. endif
  15. if g:jedi#usages_command != ''
  16. execute "nnoremap <buffer> ".g:jedi#usages_command." :call jedi#usages()<CR>"
  17. endif
  18. " rename
  19. if g:jedi#rename_command != ''
  20. execute "nnoremap <buffer> ".g:jedi#rename_command." :call jedi#rename()<CR>"
  21. endif
  22. " documentation/pydoc
  23. if g:jedi#documentation_command != ''
  24. execute "nnoremap <silent> <buffer>".g:jedi#documentation_command." :call jedi#show_documentation()<CR>"
  25. endif
  26. if g:jedi#show_call_signatures > 0 && has('conceal')
  27. call jedi#configure_call_signatures()
  28. endif
  29. if g:jedi#completions_enabled == 1
  30. inoremap <silent> <buffer> . .<C-R>=jedi#complete_string(1)<CR>
  31. endif
  32. if g:jedi#auto_close_doc
  33. " close preview if its still open after insert
  34. autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
  35. endif
  36. endif