My problem is that I know vim only as well as I absolutely have to, and I think I may have gotten into trouble getting this jedi-vim to work...

I use the following arch for my plugins:

  • pathogen
  • bundle/pkg-X.git (if pkg came from git)
  • bundle/pdg-X.vim (if pkg had to be curled or whatever)

I've cloned jedi-vim as bundle/jedi.git; however, I have moved it to jedi-vim. I'd prefer to keep it as jedi.git, if that is not going to break anything.

Anyways, I have installed jedi vim by placing it in my bundle stack. I have also added the settings from github.

" Jedi settings (python autocompletion and insight)
let g:jedi#auto_initialization = 1
let g:jedi#auto_vim_configuration = 1
let g:jedi#use_tabs_not_buffers = 1
let g:jedi#use_splits_not_buffers = "left"
let g:jedi#popup_on_dot = 1
let g:jedi#popup_select_first = 0
let g:jedi#show_call_signatures = "1"

" Jedi settings that are subject to change
let g:jedi#goto_command = "<leader>d"
let g:jedi#goto_assignments_command = "<leader>g"
let g:jedi#goto_stubs_command = "<leader>s"
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"

let g:jedi#environment_path = "/usr/bin/env python3"

let g:jedi#completions_enabled = 1

And there is another twist: I am (or used to be) a C/C++ guy, and the Omni complete is set up for that. I have tried to adapt it to jedi-vim, but perhaps this is the error:

"Plugin Manager: Pathogen
execute pathogen#infect()
syntax on
filetype plugin indent on

set autoindent
set tabstop=2
set softtabstop=2
set shiftwidth=2
colorscheme industry
set autoindent
set foldmethod=syntax

set nocp

set omnifunc=syntaxcomplete#Complete
au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main
au BufNewFile,BufRead,BufEnter *.py, set omnifunc=jedi#completions
noremap ~~ :! bash -c "git rev-parse --show-toplevel \| xargs -I {} ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q {}"<CR>

" OmniCppComplete
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
"let OmniCpp_DefaultNamespaces = ["std", \"_GLIBCXX_STD"]
" automatically open and close the popup menu / preview window
"au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
"set completeopt=menuone,menu,longest,preview

With the key line there being:

au BufNewFile,BufRead,BufEnter *.py, set omnifunc=jedi#completions

Is there some setting that might need to be set for jedi-vim completion to work?

Or perhaps a ritual I need to perform (like ctags), as I must for C/C++?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.