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

Added possibility to show shorten project dir on Git #300

Open maoueh opened 5 years ago

maoueh commented 5 years ago

Added a new option BULLETTRAIN_DIR_SHORTEN_GIT_REPO available through prompt_dir that will displays a shorten prompt dir if the current working directory is within a git repository.

For a prompt_dir of /Users/john/work/project/a where a has a .git folder, the prompt dir when using BULLETTRAIN_DIR_SHORTEN_GIT_REPO would be simply a. For a prompt_dir of /Users/john/work/project/b/nested/deep where b has a .git folder, the prompt dir when using BULLETTRAIN_DIR_SHORTEN_GIT_REPO would be b/nested/deep.

If there is no .git directory within the working directory or its parent, then prompt_dir behaves as before.