NVM Lazy Loading Support & VirtualENV Formatting #274
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 referencenode
instead ofnvm
). Before refactoring, the function relied heavily on the NVM init script beingsource
'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 oldprompt_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 forpyenv
should indeed have a space following it.before: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 withblack
. I believe that there is truly not enough contrast between the yellow background and a white foreground (text), and thus made the change.before:
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 byoh-my-zsh
.