AutoYADM commit: 2025-06-21 14:50:55
This commit is contained in:
parent
c77e27986d
commit
2916202969
2 changed files with 25 additions and 2 deletions
23
.config/kak/autoload/rename.kak
Normal file
23
.config/kak/autoload/rename.kak
Normal file
|
@ -0,0 +1,23 @@
|
|||
define-command -docstring %{
|
||||
move-file <name>: move the file on the filesystem and the open buffer.
|
||||
} -params 1 move-file %{
|
||||
nop %sh{
|
||||
old="${kak_bufname}"
|
||||
echo "rename-buffer $1 ; write" >$kak_command_fifo
|
||||
rm "$old"
|
||||
}
|
||||
}
|
||||
alias global mv move-file
|
||||
|
||||
define-command -docstring %{
|
||||
rename-file <name>: rename the file on filesystem and buffer,
|
||||
keeping the same directory.
|
||||
} -params 1 rename-file %{
|
||||
nop %sh{
|
||||
dir="${kak_buffile%/*}"
|
||||
# base="${kak_buffile##/*}"
|
||||
new="${dir}/$1"
|
||||
echo "rename-buffer $new ; write" >$kak_command_fifo
|
||||
rm "$kak_buffile"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue