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 python-venv state #74

Closed
wants to merge 3 commits into from
Closed

add python-venv state #74

wants to merge 3 commits into from

Conversation

Peter-Chou
Copy link
Contributor

@Peter-Chou Peter-Chou commented Dec 25, 2018

add python-venv state using python-shell-virtualenv-root variable, Any virtual environment manager,e.g. pipenv.el, pyvenv.el, conda.el, which changes this variable can trigger the python-venv state

venv activated in non-pipenv project:

image

venv deactivated in non-pipenv project:

image

venv activated in pipenv project:

image

venv deactivated in pipenv project:

image

In these demos, I used pyvenv.el instead of pipenv.el to manage the virtual environment

@seagle0128
Copy link
Owner

Thanks for the PR!

If I understand correctly, you want to add a segment of venv state after major-mode and version. But I don't understand what's the meaning of displaying the directory in mode-line. I took a quick look at the codes of pyvenv. Actually pyvenv-mode-line-indicator will be showed in mode-line-misc-info of mode-line. That makes more sense. doom-modeline supports mode-line-misc-info, so I don't think this segment is necessary.

What's more, the codes will cause some exceptions. I added the comments there.

@Peter-Chou
Copy link
Contributor Author

You are right, I haven't thought about it.
normally I use the functions in pyvenv-mode without enabling the minor mode and pyvenv-mode-line-indicator won't be shown in modeline if it were used in that way.
It seems this segment is more suitable for the customized usage scenarios.
Thank you for informing me about that 😚

@Peter-Chou Peter-Chou closed this Dec 25, 2018
@seagle0128
Copy link
Owner

If you prefer the standalone segment for pyvenv, should keep it similar as pyvenv-mode-line-indicator or just leverage it. That should be flexible and make sense. Thanks again!

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