From 2cad0dfef1f28b54a2a9c66f7ee686b4823741b7 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Mon, 30 Oct 2023 22:46:20 -0700 Subject: [PATCH] Add trash-rm --- init.zsh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/init.zsh b/init.zsh index 045a3db..d339d0f 100644 --- a/init.zsh +++ b/init.zsh @@ -83,12 +83,22 @@ export VISUAL="${EDITOR}" alias se=sudoedit # Safer file functions -local rm_confirm_flag='-i' -uname | grep -i linux >/dev/null && rm_confirm_flag='-I' -alias rm="rm ${rm_confirm_flag}" alias cp="cp -i" alias mv="mv -i" +# Trash put for safety +if cmd_exists trash-put; then + alias rm=trash-put + alias trr=trash-restore + alias trl=trash-list + alias tre=trash-empty + alias trm=trash-rm +else + local rm_confirm_flag='-i' + uname | grep -i linux >/dev/null && rm_confirm_flag='-I' + alias rm="rm ${rm_confirm_flag}" +fi + # Enable mouse support in less export LESS="--mouse"