Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add g:jedi#virtualenv_path to specify virtualenv #926

Closed
wants to merge 2 commits into from

Conversation

theoremoon
Copy link

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
Collaborator

blueyed commented Apr 10, 2019

I think we should finish #836 instead.

@theoremoon
Copy link
Author

@blueyed I see. Thank you :)

@theoremoon theoremoon closed this Apr 10, 2019
@blueyed
Copy link
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