From 29162029690fc5afd437cfb9cc8fb279b36a5087 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sat, 21 Jun 2025 14:50:55 -0400 Subject: [PATCH] AutoYADM commit: 2025-06-21 14:50:55 --- .config/kak/autoload/hump.kak | 4 ++-- .config/kak/autoload/rename.kak | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .config/kak/autoload/rename.kak diff --git a/.config/kak/autoload/hump.kak b/.config/kak/autoload/hump.kak index e9c358be..047ad2b0 100644 --- a/.config/kak/autoload/hump.kak +++ b/.config/kak/autoload/hump.kak @@ -22,8 +22,8 @@ define-command -hidden extend-previous-hump %{ execute-keys [A-Z][a-z]+|[A-Z]+|[a-z]+ } -map global normal ': select-previous-hump' -docstring 'select prev hump' +map global normal ': select-previous-hump' -docstring 'select prev hump' map global normal ': select-next-hump' -docstring 'select next hump' -map global normal ': extend-previous-hump' -docstring 'extend prev hump' +map global normal ': extend-previous-hump' -docstring 'extend prev hump' map global normal ': extend-next-hump' -docstring 'extend next hump' map global normal ': select-current-hump' -docstring 'select current hump' diff --git a/.config/kak/autoload/rename.kak b/.config/kak/autoload/rename.kak new file mode 100644 index 00000000..06196a5b --- /dev/null +++ b/.config/kak/autoload/rename.kak @@ -0,0 +1,23 @@ +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" + } +}