From 4af383c1eb48573b6a0ccd7a3e6d568bed5acfb1 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sat, 5 Jul 2025 13:20:27 -0500 Subject: [PATCH] fish config source --- roy-config/fish/config.fish | 3 +++ roy-config/fish/fish_variables | 31 ++++++++++++++++++++++ roy-config/fish/functions/fish_prompt.fish | 31 ++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 roy-config/fish/config.fish create mode 100644 roy-config/fish/fish_variables create mode 100644 roy-config/fish/functions/fish_prompt.fish diff --git a/roy-config/fish/config.fish b/roy-config/fish/config.fish new file mode 100644 index 0000000..d714361 --- /dev/null +++ b/roy-config/fish/config.fish @@ -0,0 +1,3 @@ +if status is-interactive + # Commands to run in interactive sessions can go here +end diff --git a/roy-config/fish/fish_variables b/roy-config/fish/fish_variables new file mode 100644 index 0000000..74b1ee1 --- /dev/null +++ b/roy-config/fish/fish_variables @@ -0,0 +1,31 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:3800 +SETUVAR fish_color_autosuggestion:brblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:normal +SETUVAR fish_color_comment:red +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:green +SETUVAR fish_color_error:brred +SETUVAR fish_color_escape:brcyan +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:brcyan +SETUVAR fish_color_param:cyan +SETUVAR fish_color_quote:yellow +SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold +SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:yellow\x1e\x2di +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2dr diff --git a/roy-config/fish/functions/fish_prompt.fish b/roy-config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..33ee160 --- /dev/null +++ b/roy-config/fish/functions/fish_prompt.fish @@ -0,0 +1,31 @@ +function fish_prompt --description 'Write out the prompt' + set -l last_pipestatus $pipestatus + set -lx __fish_last_status $status # Export for __fish_print_pipestatus. + set -l normal (set_color normal) + set -q fish_color_status + or set -g fish_color_status red + + # Color the prompt differently when we're root + set -l color_cwd $fish_color_cwd + set -l suffix '>' + if functions -q fish_is_root_user; and fish_is_root_user + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + end + set suffix '#' + end + + # Write pipestatus + # If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it. + set -l bold_flag --bold + set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation + if test $__fish_prompt_status_generation = $status_generation + set bold_flag + end + set __fish_prompt_status_generation $status_generation + set -l status_color (set_color $fish_color_status) + set -l statusb_color (set_color $bold_flag $fish_color_status) + set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) + + echo -n -s (prompt_login)' ' (set_color $color_cwd) (pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " " +end