dotfiles/config/fish/functions/fish_prompt.fish (view raw)
| 1 | function fish_prompt |
| 2 | set -l last_status $status |
| 3 | set -l cwd (prompt_pwd --full-length-dirs 1) |
| 4 | set -l vcs (prompt_vcs) |
| 5 | |
| 6 | switch $fish_bind_mode |
| 7 | case default |
| 8 | set mode_char "❮" |
| 9 | set mode_color (set_color cyan) |
| 10 | case '*' |
| 11 | set mode_char "❯" |
| 12 | if test $last_status -eq 0 |
| 13 | set mode_color (set_color green) |
| 14 | else |
| 15 | set mode_color (set_color red) |
| 16 | end |
| 17 | end |
| 18 | |
| 19 | printf '%s%s%s%s %s%s%s ' (set_color cyan) $cwd (set_color normal) $vcs $mode_color $mode_char (set_color normal) |
| 20 | end |