AutoYADM commit: 2025-06-21 15:05:57

This commit is contained in:
Daniel Fichtinger 2025-06-21 15:05:57 -04:00
parent 2916202969
commit 00c70d3feb

View file

@ -21,3 +21,31 @@ define-command -docstring %{
rm "$kak_buffile"
}
}
alias global rf rename-file
define-command -params 0..2 remove-file %{
eval %sh{
if [ "$1" = "-f" ]; then
force="true"
shift
fi
if [ -z "$1" ]; then
targ="$kak_buffile"
targ_bname="$kak_bufname"
else
targ="$(realpath ${1})"
targ_bname="$1"
fi
if [ "$kak_modified" = "true" ]; then
if [ "$force" != "true" ]; then
echo "fail 'Refusing to remove modified buffer without -f switch.'"
else
echo "delete-buffer! $targ_bname" >$kak_command_fifo
rm "$targ"
fi
else
echo "delete-buffer $targ_bname" >$kak_command_fifo
rm "$targ"
fi
}
}