1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-22 11:31:30 +01:00

zsh: functions: add bak/unbak functions

This commit is contained in:
bretello 2024-08-12 17:39:42 +02:00
parent 5ad7209f8f
commit f9ed01397c

View File

@ -367,6 +367,16 @@ function watchc() {
watch --differences --interval 1 --color grc --colour=on $@ watch --differences --interval 1 --color grc --colour=on $@
} }
# make a backup copy of the argument adding the .bak suffix
function bak() {
cp $1{,.bak}
}
# restore a backup copy created using `bak`
function unbak() {
mv $1{.bak,}
}
# highlight functions with when calling which # highlight functions with when calling which
function which(){ function which(){
if ! (($+commands[bat])); then if ! (($+commands[bat])); then