diff --git a/functions/misc.zsh b/functions/misc.zsh index 08c6b59..f62cbbe 100755 --- a/functions/misc.zsh +++ b/functions/misc.zsh @@ -364,7 +364,17 @@ function watch_and_run() { # use watch and force color with grc 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