Home

Awesome

<i>H</i>ydro

Ultra-pure, lag-free prompt with async Git status. Designed only for Fish.

Installation

Install with Fisher:

fisher install jorgebucaran/hydro

Features

One prompt symbol to rule them all. Change it?

<pre> <b>~</b> ❱ ⎢ </pre>

Display Git branch name and status—prompt repaints asynchronously! ✨

<pre> ~/p/<b>hydro</b> main ❱ touch Solution ~/p/<b>hydro</b> main• ❱ ⎢ </pre>

indicates that there are staged, unstaged or untracked files.

Display how many commits ahead and/or behind you are of your upstream—prompt repaints asynchronously!

<pre> ~/p/<b>hydro</b> main• ↓2 ❱ git commit -am Hotfix ~/p/<b>hydro</b> main ↑1 ↓2 ❱ git pull --rebase && git push ~/p/<b>hydro</b> main ❱ ⎢ </pre>

Display $CMD_DURATION when > 1 second. Configurable.

<pre> ~/p/<b>hydro</b> main ❱ git push --quiet ~/p/<b>hydro</b> main 1.1s ❱ ⎢ </pre>

Display the last non-zero exit status (or statuses) using $pipestatus.

<pre> ~/p/<b>hydro</b> main ❱ false ~/p/<b>hydro</b> main | <b>1</b> ❱ ⎢ ~/p/<b>hydro</b> main ❱ true | false | false ~/p/<b>hydro</b> main | <b>0</b> <b>1</b> <b>1</b> ❱ ⎢ </pre>

Truncate $PWD segments except for the basename and root of Git repos.

<pre> <b>~</b> ❱ projects/hydro/ ~/p/<b>hydro</b> ❱ functions/share/ ~/p/hydro/f/<b>share</b> ❱ ⎢ </pre>

Display the current bindings mode.

<pre> <i>I</i> <b>~</b> ❱ <kbd>Esc</kbd> <i>N</i> <b>~</b> ❱ <kbd>R</kbd> <i>R</i> <b>~</b> ❱ ⎢ </pre>

Performance

Blazing fast would be an understatement considering that the LLVM repo has over 375,000 commits!

<pre> ~/<b>llvm-project</b> main ❱ time fish_prompt ~/<b>llvm-project</b> main ❱ ________________________________________________________ Executed in 79.00 micros fish external usr time 71.00 micros 71.00 micros 0.00 micros sys time 9.00 micros 9.00 micros 0.00 micros </pre>

Configuration

Modify variables using set --universal from the command line or set --global in your config.fish file.

Symbols

VariableTypeDescriptionDefault
hydro_symbol_startstringPrompt start symbol.
hydro_symbol_promptstringPrompt symbol.
hydro_symbol_git_dirtystringDirty repository symbol.
hydro_symbol_git_aheadstringAhead of your upstream symbol.
hydro_symbol_git_behindstringBehind of your upstream symbol.

Colors

Any argument accepted by set_color.

VariableTypeDescriptionDefault
hydro_color_pwdcolorColor of the pwd segment.$fish_color_normal
hydro_color_gitcolorColor of the git segment.$fish_color_normal
hydro_color_startcolorColor of the start symbol.$fish_color_normal
hydro_color_errorcolorColor of the error segment.$fish_color_error
hydro_color_promptcolorColor of the prompt symbol.$fish_color_normal
hydro_color_durationcolorColor of the duration section.$fish_color_normal

Flags

VariableTypeDescriptionDefault
hydro_fetchbooleanFetch git remote in the background.false
hydro_multilinebooleanDisplay prompt character on a separate line.false

Misc

VariableTypeDescriptionDefault
fish_prompt_pwd_dir_lengthnumericThe number of characters to display when path shortening. Set it to 0 to display only the topmost (current) directory.1
hydro_ignored_git_pathsstringsSpace separated list of paths where no git info should be displayed.""
hydro_cmd_duration_thresholdnumericMinimum command duration, in milliseconds, after which command duration is displayed.1000

License

MIT