[zsh] 增加一些工具函数

This commit is contained in:
2026-01-24 22:40:36 +08:00
parent 6a31fd1d9e
commit 012d2a34b9
3 changed files with 23 additions and 11 deletions
+14
View File
@@ -36,3 +36,17 @@ sops-update-file() {
rm -f "$tmp"
return $rc
}
sops-update-ssh-config () {( set -e
local SSH_CONFIG=$HOME/.ssh/config
local FLAKES=$HOME/flakes
$EDITOR $SSH_CONFIG
sops-update-file $SSH_CONFIG $FLAKES/secrets/ssh-config.yaml
pushd $FLAKES
if [[ -z "$(git status --porcelain)" ]]; then
git add .
git commit -m "[sops] update ssh config"
fi
popd
)}
+1 -3
View File
@@ -20,9 +20,7 @@ setopt interactivecomments
unsetopt extended_glob
# alias
export EDITOR=helix
alias edit=$EDITOR
alias vim=helix
export EDITOR=hx
alias dc="docker compose"
export PATH="$HOME/.local/bin:$PATH"