Skip to content

add g:jedi#virtualenv_path to specify virtualenv#926

Closed
theoremoon wants to merge 2 commits intodavidhalter:masterfrom
theoremoon:theoldmoon0602
Closed

add g:jedi#virtualenv_path to specify virtualenv#926
theoremoon wants to merge 2 commits intodavidhalter:masterfrom
theoremoon:theoldmoon0602

Conversation

@theoremoon
Copy link
Copy Markdown

Hello.

I added g:jedi#vritualenv_path to specify the virtual environment like $VIRTUAL_ENV, but this will work even after Jedi is started.

Would you please merge if you think this feature is good.

The following script is my usage.

" set the pipenv's environment for completion when open .py file
function! s:setPipenvPath()
  let pipenv_dir = expand('%:p:h')
  if !filereadable(l:pipenv_dir . '/Pipfile')
    return
  endif

  let venv_path = trim(system(printf("sh -c 'cd %s; pipenv --venv'", pipenv_dir)))
  let g:jedi#virtualenv_path = venv_path
endfunction

autocmd FileType python :call s:addPipenvPath()

@blueyed
Copy link
Copy Markdown
Collaborator

blueyed commented Apr 10, 2019

I think we should finish #836 instead.

@theoremoon
Copy link
Copy Markdown
Author

@blueyed I see. Thank you :)

@theoremoon theoremoon closed this Apr 10, 2019
@blueyed
Copy link
Copy Markdown
Collaborator

blueyed commented Apr 11, 2019

Thanks for your PR in the first place anyway, of course!

Please give #836 a try/review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants