Shortening my prompt in Zsh

后端 未结 4 1885
青春惊慌失措
青春惊慌失措 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:37

    add this to ~/.zshrc

    prompt_dir() {
      prompt_segment blue $CURRENT_FG '%2~'
    }
    

    Explanatory note: %~ will limit the number of path segments leading up to the current directory to N. I.e. %2~ will show only two last segments: the current directory and its parent directory.

提交回复
热议问题