caiogondim / bullet-train.zsh

:bullettrain_side: An oh-my-zsh shell theme based on the Powerline Vim plugin
MIT License
2.82k stars 382 forks source link

NVM Lazy Loading Support & VirtualENV Formatting #274

Open FrederickGeek8 opened 6 years ago

FrederickGeek8 commented 6 years ago

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.