From d5f92c72c3324127482fb253dba082971051edfa Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Wed, 15 Nov 2017 09:37:19 -0500 Subject: [PATCH] Initial commit --- config.fish | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 config.fish diff --git a/config.fish b/config.fish new file mode 100644 index 0000000..1b265c0 --- /dev/null +++ b/config.fish @@ -0,0 +1,58 @@ +#################################### +# Jessie Hildebrandt's Fish Config # +#################################### + +##################### +# Setting Variables # +##################### + +set __fish_git_prompt_show_informative_status 1 + +set fish_greeting "" +set fish_key_bindings fish_default_key_bindings + +################### +# Prompt Function # +################### + +function fish_prompt --description 'Write out the prompt' + + # Get Exit Status + set -l last_status $status + + # Color Definitions + set -l normal_color (set_color normal) + set -l usr_color (set_color brgreen) + set -l dir_color (set_color brblue) + + set -l vcs_color (set_color brblack) + set -l err_color (set_color red) + + # User/Hostname Formatting + set -l user_host $usr_color $USER "@" (hostname -s) "$normal_color" + + # Working Directory Formatting + set -l home_escaped (echo -n $HOME | sed 's/\//\\\\\//g') + set -l pwd (echo -n $PWD | sed "s/^$home_escaped/~/") + set -l current_dir "$dir_color" "$pwd" "$normal_color" + + # Suffix Symbol Selection + set -l suffix "" + switch $USER + case root toor; set suffix "#" + case "*"; set suffix ">" + end + + # VCS Status Formatting + set -l vcs_status "$vcs_color" (__fish_vcs_prompt) "$normal_color" + + # Exit Status Formatting + set -l prompt_status + if test $last_status -ne 0 + set prompt_status " " "$err_color" "[$last_status]" "$normal_color" + end + + # Print Prompt + echo -n -s $user_host " " $current_dir $vcs_status $prompt_status $suffix " " + +end \ No newline at end of file