zsh: Move {,un}bkp from aliases to functions
Since both were functions already their place seems more appropriate in
functions.zsh. This also fixes the completion of both, since they did
not complete files before.
Other changes in `unbkp`:
- Use `mv` instead of `cp`
- Fix little typo (forgotten quote) and support specifying the
original name instead of only the backup.
- Do not "rename" the file if there is no change in name
(Leading to the prompt if the file should be overwritten)
This commit is contained in:
@@ -99,10 +99,6 @@
|
||||
alias lowres='() {
|
||||
xrandr -s 1920x1080; $1 "${@[2,-1]}"; xrandr -s 3200x1800
|
||||
}'
|
||||
# Create copy with .bkp extension
|
||||
alias bkp='() { for f; do command cp -i "$f"{,.bkp}; done }'
|
||||
# Reverse bkp()
|
||||
alias unbkp='() { for f; do command cp -i "$f" "${f%.bkp}; done }'
|
||||
# Grep in history file
|
||||
alias histgrep='() { grep "$@" "${HISTFILE:-$HOME/.zsh_history}" }'
|
||||
# URL-encode
|
||||
|
||||
Reference in New Issue
Block a user