⚡️

Zsh Abbr Path

theme_title_use_abbreviated_path equivalent for zsh on osx

felixgravila
|
9 stars
4 forks

abbreviated pwd for oh-my-zsh

Functionality of the theme_title_use_abbreviated_path parameter from some oh-my-fish themes

Displays the current path with all but the last directory shortened to the first letter

Replaces $HOME with ~

Installation

copy .abbr_pwd to $HOME then source it from your .zshrc

source $HOME/.abbr_pwd

You can use my own theme copy if agnoster suits you, but if not you can edit your theme of choice in $HOME/.oh-my-zsh/themes by finding the promptdir() method and modifying the contents to contain $(felixpwdabbr) as you wish. For agnoster it was as easy as replacing '%~' with $(felixpwd_abbr).

Screenshot

alt text

Thanks to contributors

Thank you @charlesdaniels for fix: Fixed behavior for paths containing hidden directories