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

NVM Lazy Loading Support & VirtualENV Formatting #274

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

FrederickGeek8
Copy link

@FrederickGeek8 FrederickGeek8 commented Apr 9, 2018

I've made a couple of changes in my pull request, some small, others larger. While these could have been split into separate pull requests, the last two changes are so small that I felt they did not deserve their own PR (although they seem, to me, to likely not be subject to criticisms).

NVM Lazy Loading Support
The biggest change is the refactoring of the prompt_nvm function, something which partially addresses the issue #135 (this does not rename variables and functions to reference node instead of nvm). Before refactoring, the function relied heavily on the NVM init script being source'd on shell start, and thus if lazy loading was attempted, a couple of things would break. Not only would the purpose of lazy loading (to defer the slow loading of NVM) be defeated, but due to sub-shells being unable to modify parent shells, but the old prompt_nvm would result in the NVM init script being sourced every time it was called, thus slowing the shell by an incredibly amount.

VirtualENV Formatting
There is a break in consistency with the formatting used in the VirtualENV section of environment variable declarations. Whereas for NVM you have ...PREFIX="⬡ " (with a space following the pentagon), the prefix for VirtualENV/pyenv does not contain this space (i.e. ...PREFIX=="🐍"). Not only does this look visually displeasing, but the continuity break would suggest that the prefix for pyenv should indeed have a space following it.
before: before
after: after
This was only behavior I was experiencing on an older version of OMZ. With the most recent version of OMZ, the behavior seems to be fixed (not sure why).

Additionally I made the change to replace the color white used as the VirtualENV foreground color with black. I believe that there is truly not enough contrast between the yellow background and a white foreground (text), and thus made the change.
before:screen shot 2018-04-09 at 9 09 47 am
after: after

Makefile Update
I made a small change to the makefile as I discovered that it was installing the bullet-train theme to the main theme directory, and not the custom theme directory, thus breaking from the standard set by oh-my-zsh.

The makefile was placing the bullet-train theme in the main theme
directory and not the designated custom themes directory.
Added space between the python and the version number (consistent with
NVM).
Changed VirtualENV FG color (text color) to black to better contrast
against the yellow BG.
A refactor of the prompt_nvm function that allows for lazy-loading NVM
(that which does not source the NVM init script on shell start)
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.

1 participant