define-command -docstring %{ move-file : 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 : 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" } }