From c207ac077570240bed7d0eb2025178e12c8fd55a Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 23 Nov 2025 16:37:55 +0800 Subject: bump: fish --- dot-config/fish/conf.d/abbr.fish | 11 +++++++---- dot-config/fish/conf.d/funcs.fish | 4 ++-- dot-config/fish/conf.d/git.abbr.fish | 13 ++++++++++++- dot-config/fish/conf.d/jj.abbr.fish | 18 ------------------ dot-config/fish/conf.d/jj.abbr.fish.disabled | 18 ++++++++++++++++++ dot-config/fish/conf.d/pacman.abbr.fish | 2 +- dot-config/fish/conf.d/prompt.options.fish | 3 +++ dot-config/fish/functions/fish_prompt.fish | 12 ++++++------ 8 files changed, 49 insertions(+), 32 deletions(-) delete mode 100644 dot-config/fish/conf.d/jj.abbr.fish create mode 100644 dot-config/fish/conf.d/jj.abbr.fish.disabled diff --git a/dot-config/fish/conf.d/abbr.fish b/dot-config/fish/conf.d/abbr.fish index 9bf7d10b..5ec3b905 100644 --- a/dot-config/fish/conf.d/abbr.fish +++ b/dot-config/fish/conf.d/abbr.fish @@ -127,7 +127,7 @@ abbr -a pipreqsi installpipreqs # better discord #alias discord='discord-screenaudio' # better wget -abbr -a wget "aria2c -x 16" +alias wget="aria2c -x 16" # audios abbr -a audio pulsemixer abbr -a audiod pipewire-pulse @@ -143,8 +143,6 @@ abbr -a config-polybar "vim ~/.config/bspwm/themes/default/polybar/config.ini" # tars abbr -a tarxz "tar -xvJf" abbr -a targz "tar -xvzf" -# faster(vim) -abbr -a v hx ## auto fuck # better finds #alias find='sudo find / | grep ' @@ -329,7 +327,8 @@ abbr -a cpuperf "sudo cpupower frequency-set -g performance" abbr -a cpups "sudo cpupower frequency-set -g powersave" # better time benchmark -abbr -a time "hyperfine --warmup 3 -N" +# abbr -a time "hyperfine --warmup 3 -N" +# alias time="hyperfine --warmup 3 -N" function '??' set file (mktemp) @@ -343,3 +342,7 @@ abbr -a icat "kitten icat" # abbr -a cd z abbr -a md mkdir + +function mkcd + mkdir $argv && cd $argv +end diff --git a/dot-config/fish/conf.d/funcs.fish b/dot-config/fish/conf.d/funcs.fish index 009c3d51..5e3d01a3 100644 --- a/dot-config/fish/conf.d/funcs.fish +++ b/dot-config/fish/conf.d/funcs.fish @@ -1,5 +1,5 @@ -# hx with auto sudo -function hx +# with auto sudo +function v if test (count $argv) -eq 0 if not test -w (pwd) printf "Opening hx with sudo...\n" diff --git a/dot-config/fish/conf.d/git.abbr.fish b/dot-config/fish/conf.d/git.abbr.fish index c267e7d4..d793d22b 100644 --- a/dot-config/fish/conf.d/git.abbr.fish +++ b/dot-config/fish/conf.d/git.abbr.fish @@ -53,7 +53,14 @@ end # alias push="git push" abbr -a git-rm "git ls-files --deleted -z | xargs -0 git rm" # alias g=git -#alias ga='git add' +# alias ga='git add' +function ga + if test (count $argv) -gt 0 + git add -f $argv + else + git add -A + end +end # alias gaa='git add --all' # alias gam='git am' # alias gama='git am --abort' @@ -258,3 +265,7 @@ end # alias ghpr='gh pr' # alias ghis='gh issue' abbr -a bisectundo 'git bisect log | head -n -2 > /tmp/fixed_bisect.log ; git bisect replay /tmp/fixed_bisect.log' +function gf + git commit --fixup=$argv + git rebase -i --autosquash $argv^ +end diff --git a/dot-config/fish/conf.d/jj.abbr.fish b/dot-config/fish/conf.d/jj.abbr.fish deleted file mode 100644 index 3611d60c..00000000 --- a/dot-config/fish/conf.d/jj.abbr.fish +++ /dev/null @@ -1,18 +0,0 @@ -abbr -a g jj -abbr -a gp 'jj git push --tracked' -abbr -a gpd 'jj git push --deleted' -abbr -a gs 'jj st' -abbr -a gl 'jj log' -abbr -a gc 'jj commit -m' -abbr -a gb 'jj bookmark' -abbr -a gi 'jj --ignore-immutable' -abbr -a gr 'jj git remote' -function gd - if test (count $argv) -ge 2 - jj diff --from $argv[1] --to $argv[2] - else if test (count $argv) -ge 1 - jj diff --from $argv[1] --to @ - else - jj diff --from @- --to @ - end -end diff --git a/dot-config/fish/conf.d/jj.abbr.fish.disabled b/dot-config/fish/conf.d/jj.abbr.fish.disabled new file mode 100644 index 00000000..5c67a686 --- /dev/null +++ b/dot-config/fish/conf.d/jj.abbr.fish.disabled @@ -0,0 +1,18 @@ +abbr -a g jj +abbr -a gp 'jj git push --tracked' +abbr -a gpd 'jj git push --deleted' +abbr -a gs 'jj st' +abbr -a gl 'jj log' +abbr -a gc 'jj commit' +abbr -a gb 'jj bookmark' +abbr -a gi 'jj --ignore-immutable' +abbr -a gr 'jj git remote' +function gd + if test (count $argv) -ge 2 + jj diff --from $argv[1] --to $argv[2] + else if test (count $argv) -ge 1 + jj diff --from $argv[1] --to @ + else + jj diff --from @- --to @ + end +end diff --git a/dot-config/fish/conf.d/pacman.abbr.fish b/dot-config/fish/conf.d/pacman.abbr.fish index dd270bdc..b241913f 100644 --- a/dot-config/fish/conf.d/pacman.abbr.fish +++ b/dot-config/fish/conf.d/pacman.abbr.fish @@ -21,7 +21,7 @@ alias mirrora "sudo reflector --latest 50 --number 20 --sort age --save /etc/pac alias packagelistignoreall 'paru --color always -Sl | sed -e "s: :/:; s/ unknown-version//; /已安装/d" | fzf --multi --ansi --preview "yay -Si {1}" | cut -d" " -f1 | xargs -ro yay -S' alias package "paru --color always -Sl \ | fzf --multi --ansi --preview 'yay -Si {2}' \ - | awk '{print $2}' \ + | awk '{print \$2}' \ | xargs -r yay -S --noconfirm" # alias packagelist 'paru --color always -Sl | sed -e "s: :/:; /unknown-version/d" | fzf --multi --ansi --preview "yay -Si {1}" | cut -d" " -f1 | xargs -ro yay -S' alias packagef "/usr/bin/cat /tmp/yaySl | cut -d' ' -f2 | fzf --multi --ansi --preview 'yay -Si {1}' | xargs -ro paru -S --skipreview --needed" diff --git a/dot-config/fish/conf.d/prompt.options.fish b/dot-config/fish/conf.d/prompt.options.fish index cc226746..79f60899 100644 --- a/dot-config/fish/conf.d/prompt.options.fish +++ b/dot-config/fish/conf.d/prompt.options.fish @@ -5,5 +5,8 @@ set -g __fish_git_prompt_showuntrackedfiles 1 set -g __fish_git_prompt_showupstream auto set -g __fish_git_prompt_showstashstate 1 set -g __fish_git_prompt_showcolorhints 1 +# from p10k +set -g __fish_git_prompt_char_untrackedfiles "?" +set -g __fish_git_prompt_char_stashstate "*" set -g fish_prompt_pwd_dir_length 0 diff --git a/dot-config/fish/functions/fish_prompt.fish b/dot-config/fish/functions/fish_prompt.fish index 55f8453e..d0185bbd 100644 --- a/dot-config/fish/functions/fish_prompt.fish +++ b/dot-config/fish/functions/fish_prompt.fish @@ -103,14 +103,14 @@ function fish_prompt and _nim_prompt_wrapper $retc '' (path basename "$VIRTUAL_ENV") # git - # set -l prompt_git (fish_git_prompt '%s') - # test -n "$prompt_git" - # and _nim_prompt_wrapper $retc '' $prompt_git + set -l prompt_git (fish_git_prompt '%s') + test -n "$prompt_git" + and _nim_prompt_wrapper $retc '' $prompt_git # jj - set -l prompt_jj (fish_jj_prompt '%s') - test -n "$prompt_jj" - and _nim_prompt_wrapper $retc '' $prompt_jj + # set -l prompt_jj (fish_jj_prompt '%s') + # test -n "$prompt_jj" + # and _nim_prompt_wrapper $retc '' $prompt_jj test ! $prompt_status = 0; and _nim_prompt_wrapper $retc '' (fish_status_to_signal $prompt_status) -- cgit v1.2.3