[zsh] 增加一些工具函数
This commit is contained in:
@@ -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
|
||||
)}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user