1
0
Fork 0

zsh: test file before editing in whed()

This commit is contained in:
Luca Bilke 2024-07-10 13:41:46 +02:00
parent 179e550673
commit 5ecbf9acf0
Signed by: luca
GPG Key ID: F6E11C9BAA7C82F5
2 changed files with 4 additions and 1 deletions

View File

@ -82,3 +82,7 @@ function togglefg () {
zle accept-line -w
}
zle -N togglefg
function whed() {
[ -e "$1" ] && $EDITOR $(which "$1")
}

View File

@ -41,7 +41,6 @@ alias \
# Quasi functions
alias \
xgetkeys="xev | sed -ne '/^KeyPress/,/^$/p'" \
whed='() { $EDITOR $(which "$1") }' \
xpick="xprop | awk '
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"