jorgebucaran / hydro

Ultra-pure, lag-free prompt with async Git status—just for Fish
MIT License
637 stars 53 forks source link

add an option to display only the current directory #33

Closed vermarine closed 2 years ago

vermarine commented 2 years ago

I like my prompt to be as short as possible so I've added an option to remove the trailing directories from the prompt to leave only the topmost (current) directory. This means that if you are in /home/user/projects/foo/bar it would only display bar. Since this would prevent the user to know when they are located in / I've added a check for this so that it displays / when at the root of the filesystem. This feature is turned off by default but can be enabled by setting hydro_pwd_currentdir_only to true

jorgebucaran commented 2 years ago

This is an interesting idea, I'll think about it. 👌

jorgebucaran commented 2 years ago

@vermarine Question. Should it display also ~ when you are in your home directory?

jorgebucaran commented 2 years ago

Rather than introducing a new variable I went with a more economical alternative which works as follows:

~/C/@/hydro main ❱ set fish_prompt_pwd_dir_length 0
hydro main ❱ ..
@jorgebucaran ❱ ..
Code ❱ ..
~ ❱ ..
Users ❱ ..
/ ❱