Shortening my prompt in Zsh

后端 未结 4 1886
青春惊慌失措
青春惊慌失措 2021-02-04 04:39

I\'m having a lot of trouble getting zsh to shorten my prompt. I\'m currently using zsh with the agnoster theme and oh-my-zsh package manager.

My prompt currently gets a

4条回答
  •  日久生厌
    2021-02-04 05:17

    Old question, I know, but as an alternative solution I just discovered powerlevel9k, an extension of agnoster (they appear practically identical bar a fair few tweaks), which has this functionality built in.

    Just set it as your zsh theme, then in .zshrc set

    POWERLEVEL9K_SHORTEN_DIR_LENGTH=2

    which ensures that only two directories are listed.

    Alternate options are outlined in the readme.

提交回复
热议问题