AutoYADM commit: 2025-06-21 15:05:57
This commit is contained in:
parent
2916202969
commit
00c70d3feb
1 changed files with 28 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue