~cricket/dotfiles

31e247bfb52efd691ecfaa2eda7ed7e138a5e746 — c piapiac 4 months ago bb3b574
use spaces instead of tabs
1 files changed, 11 insertions(+), 11 deletions(-)

M .config/fish/functions/fish_prompt.fish
M .config/fish/functions/fish_prompt.fish => .config/fish/functions/fish_prompt.fish +11 -11
@@ 1,22 1,22 @@
function fish_prompt
    set -l last_status $status 												# last command exited with
    set -l normal (set_color normal)										# reset colours / styles
    set -l aqua (set_color -o $gruvbox_neutral_aqua)						# gruvbox colours
    set -l last_status $status                                              # last command exited with
    set -l normal (set_color normal)                                        # reset colours / styles
    set -l aqua (set_color -o $gruvbox_neutral_aqua)                        # gruvbox colours
    set -l error (set_color -o -r $gruvbox_bright_red)
    set -l orange (set_color -o $gruvbox_neutral_orange)
    set -l purple (set_color -o $gruvbox_neutral_purple)
    set -l blue (set_color -o $gruvbox_neutral_blue)
    
    set -l suffix " % "														# default suffix is %
    set -l bracket_colour $orange 											# set bracket colour to orange
    [ $last_status = 1 ] && set bracket_colour $error && set suffix " ! "	# exited with failure
    [ $last_status = 127 ] && set suffix " ? "								# unknown command
    [ $last_status = 130 ] && set suffix " * " 								# script has been killed with ^C
    set -l suffix " % "                                                     # default suffix is %
    set -l bracket_colour $orange                                           # set bracket colour to orange
    [ $last_status = 1 ] && set bracket_colour $error && set suffix " ! "   # exited with failure
    [ $last_status = 127 ] && set suffix " ? "                              # unknown command
    [ $last_status = 130 ] && set suffix " * "                              # script has been killed with ^C

    set -l directory (pwd | string split "/")[-1]							# just show last directory in path
    [ $PWD = ~ ] && set directory "their home"								# set directory name to ~ if it's the home
    set -l directory (pwd | string split "/")[-1]                           # just show last directory in path
    [ $PWD = ~ ] && set directory "their home"                              # set directory name to ~ if it's the home
    
    set -l git_info															# set git info if .git exists
    set -l git_info                                                         # set git info if .git exists
    [ -d .git ] && set git_info $bracket_colour " on " $blue (git branch --show-current) 

    echo -s $bracket_colour "[" $purple $USER $bracket_colour " in " $aqua $directory $git_info $bracket_colour "]" $normal $suffix