From: Andre Ramnitz Date: Fri, 23 Jan 2026 18:46:16 +0000 (+0100) Subject: fish: 4.3.x bump X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=77d22f5eb453f9822538dda3c17b4fb77efa1b11;p=dotfiles.git fish: 4.3.x bump --- diff --git a/dot-config/fish/config.fish b/dot-config/fish/config.fish index 14b88ac6..e051af1a 100644 --- a/dot-config/fish/config.fish +++ b/dot-config/fish/config.fish @@ -8,6 +8,7 @@ if status is-interactive source (starship init fish --print-full-init | psub) set -gx EDITOR 'kak' set -gx VISUAL 'kak' + zoxide init fish | source set -g fish_greeting end @@ -34,5 +35,13 @@ bind --user \cw backward-kill-bigword fish_add_path /home/andy/.local/bin fish_add_path /home/andy/.cargo/bin fish_add_path /home/andy/go/bin +fish_add_path /home/andy/.yarn/bin fish_add_path /home/andy/Applications + +# pnpm +set -gx PNPM_HOME "/home/andy/.local/share/pnpm" +if not string match -q -- $PNPM_HOME $PATH + set -gx PATH "$PNPM_HOME" $PATH +end +# pnpm end diff --git a/dot-config/fish/fish_variables b/dot-config/fish/fish_variables index 43b67554..306844c5 100644 --- a/dot-config/fish/fish_variables +++ b/dot-config/fish/fish_variables @@ -1,32 +1,4 @@ # 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:blue -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 -SETUVAR fish_user_paths:/media/source/dart\x2dsass\x1e/home/andy/Applications\x1e/home/andy/go/bin\x1e/home/andy/\x2ecargo/bin\x1e/home/andy/\x2elocal/bin\x1e/home/andy/\x2espicetify +SETUVAR __fish_initialized:4300 +SETUVAR fish_user_paths:\x1e/media/source/dart\x2dsass\x1e/home/andy/Applications\x1e/home/andy/go/bin\x1e/home/andy/\x2ecargo/bin\x1e/home/andy/\x2elocal/bin\x1e/home/andy/\x2espicetify diff --git a/dot-config/fish/functions/fish_prompt.fish b/dot-config/fish/functions/fish_prompt.fish index b1a13c53..e203972d 100644 --- a/dot-config/fish/functions/fish_prompt.fish +++ b/dot-config/fish/functions/fish_prompt.fish @@ -1,139 +1,29 @@ function fish_prompt - # This prompt shows: - # - white lines if the last return command is OK, red otherwise - # - your user name, in red if root or yellow otherwise - # - your hostname, in cyan if ssh or blue otherwise - # - the current path (with prompt_pwd) - # - date +%X - # - the current virtual environment, if any - # - the current git status, if any, with fish_git_prompt - # - the current battery state, if any, and if your power cable is unplugged, and if you have "acpi" - # - current background jobs, if any - - # It goes from: - # ┬─[nim@Hattori:~]─[11:39:00] - # ╰─>$ echo here - - # To: - # ┬─[nim@Hattori:~/w/dashboard]─[11:37:14]─[V:django20]─[G:master↑1|●1✚1…1]─[B:85%, 05:41:42 remaining] - # │ 2 15054 0% arrêtée sleep 100000 - # │ 1 15048 0% arrêtée sleep 100000 - # ╰─>$ echo there - - set -l retc red - test $status = 0; and set retc white - - set -q __fish_git_prompt_showupstream - or set -g __fish_git_prompt_showupstream auto - - function _nim_prompt_wrapper - set retc $argv[1] - set -l field_name $argv[2] - set -l field_value $argv[3] - - set_color normal - set_color $retc - echo -n '─' - set_color -o white - echo -n '[' - set_color normal - test -n $field_name - and echo -n $field_name: - set_color $retc - echo -n $field_value - set_color -o white - echo -n ']' - end - - set_color $retc - echo -n '┬─' - set_color -o white - echo -n [ - - if functions -q fish_is_root_user; and fish_is_root_user - set_color -o red - else - set_color -o yellow - end - - echo -n $USER - set_color -o white - echo -n @ - - if test -z "$SSH_CLIENT" - set_color -o blue - else - set_color -o cyan + switch "$fish_key_bindings" + case fish_hybrid_key_bindings fish_vi_key_bindings fish_helix_key_bindings + set STARSHIP_KEYMAP "$fish_bind_mode" + case '*' + set STARSHIP_KEYMAP insert end - echo -n (prompt_hostname) - set_color -o white - echo -n :(prompt_pwd) - set_color -o white - echo -n ']' - - # Date - _nim_prompt_wrapper $retc '' (date +%X) - - # Vi-mode - # The default mode prompt would be prefixed, which ruins our alignment. - function fish_mode_prompt - end - - if test "$fish_key_bindings" = fish_vi_key_bindings - or test "$fish_key_bindings" = fish_hybrid_key_bindings - set -l mode - switch $fish_bind_mode - case default - set mode (set_color --bold red)N - case insert - set mode (set_color --bold white)I - case replace_one - set mode (set_color --bold white)R - echo '[R]' - case replace - set mode (set_color --bold cyan)R - case visual - set mode (set_color --bold magenta)V + set STARSHIP_CMD_PIPESTATUS $pipestatus + set STARSHIP_CMD_STATUS $status + # Account for changes in variable name between v2.7 and v3.0 + set STARSHIP_DURATION "$CMD_DURATION$cmd_duration" + + __starship_set_job_count + + if test "$TRANSIENT" = "1" + set -g TRANSIENT 0 + # Clear from cursor to end of screen as `commandline -f repaint` does not do this + # See https://github.com/fish-shell/fish-shell/issues/8418 + printf \e\[0J + if type -q starship_transient_prompt_func + starship_transient_prompt_func --terminal-width="$COLUMNS" --status=$STARSHIP_CMD_STATUS --pipestatus="$STARSHIP_CMD_PIPESTATUS" --keymap=$STARSHIP_KEYMAP --cmd-duration=$STARSHIP_DURATION --jobs=$STARSHIP_JOBS + else + printf "\e[1;32m❯\e[0m " end - set mode $mode(set_color normal) - _nim_prompt_wrapper $retc '' $mode - end - - - # Virtual Environment - set -q VIRTUAL_ENV_DISABLE_PROMPT - or set -g VIRTUAL_ENV_DISABLE_PROMPT true - set -q VIRTUAL_ENV - and _nim_prompt_wrapper $retc V (basename "$VIRTUAL_ENV") - - # git - set -l prompt_git (fish_git_prompt '%s') - test -n "$prompt_git" - and _nim_prompt_wrapper $retc G $prompt_git - - # Battery status - type -q acpi - and test (acpi -a 2> /dev/null | string match -r off) - and _nim_prompt_wrapper $retc B (acpi -b | cut -d' ' -f 4-) - - # New line - echo - - # Background jobs - set_color normal - - for job in (jobs) - set_color $retc - echo -n '│ ' - set_color brown - echo $job + else + /usr/bin/starship prompt --terminal-width="$COLUMNS" --status=$STARSHIP_CMD_STATUS --pipestatus="$STARSHIP_CMD_PIPESTATUS" --keymap=$STARSHIP_KEYMAP --cmd-duration=$STARSHIP_DURATION --jobs=$STARSHIP_JOBS end - - set_color normal - set_color $retc - echo -n '╰─>' - set_color -o red - echo -n '$ ' - set_color normal end diff --git a/dot-config/fish/functions/hyprconfig.fish b/dot-config/fish/functions/hyprconfig.fish index 76c0f1b9..8c507dc2 100644 --- a/dot-config/fish/functions/hyprconfig.fish +++ b/dot-config/fish/functions/hyprconfig.fish @@ -1,3 +1,3 @@ -function hyprconfig --wraps='kks edit ~/.config/hypr/hypr*.conf ~/.config/hypr/fragments/* ' --description 'alias hyprconfig=kak ~/.config/hypr/hypr*.conf ~/.config/hypr/fragments/* ' - kak ~/.config/hypr/hypr*.conf ~/.config/hypr/fragments/* $argv +function hyprconfig --wraps='kks edit ~/.config/hypr/hypr*.conf ~/.config/hypr/noctalia/*.conf ~/.config/hypr/fragments/* ' --description 'alias hyprconfig=kak ~/.config/hypr/hypr*.conf ~/.config/hypr/noctalia/*.conf ~/.config/hypr/fragments/* ' + kak ~/.config/hypr/hypr*.conf ~/.config/hypr/noctalia/*.conf ~/.config/hypr/fragments/* $argv end