summaryrefslogtreecommitdiff
path: root/dot-config
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-11-23 16:37:55 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-11-23 16:37:55 +0800
commitc207ac077570240bed7d0eb2025178e12c8fd55a (patch)
treed7456a3f089cedfcc6659a2ef073a938905ec979 /dot-config
parent33d9ab481109338ba4deca6c7a445875b33b1e59 (diff)
bump: fish
Diffstat (limited to 'dot-config')
-rw-r--r--dot-config/fish/conf.d/abbr.fish11
-rw-r--r--dot-config/fish/conf.d/funcs.fish4
-rw-r--r--dot-config/fish/conf.d/git.abbr.fish13
-rw-r--r--dot-config/fish/conf.d/jj.abbr.fish.disabled (renamed from dot-config/fish/conf.d/jj.abbr.fish)2
-rw-r--r--dot-config/fish/conf.d/pacman.abbr.fish2
-rw-r--r--dot-config/fish/conf.d/prompt.options.fish3
-rw-r--r--dot-config/fish/functions/fish_prompt.fish12
7 files changed, 32 insertions, 15 deletions
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.disabled
index 3611d60c..5c67a686 100644
--- a/dot-config/fish/conf.d/jj.abbr.fish
+++ b/dot-config/fish/conf.d/jj.abbr.fish.disabled
@@ -3,7 +3,7 @@ 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 gc 'jj commit'
abbr -a gb 'jj bookmark'
abbr -a gi 'jj --ignore-immutable'
abbr -a gr 'jj git remote'
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)