diff --git a/.config/kak/kakrc b/.config/kak/kakrc index 4e32bc53..a2c2b338 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -32,7 +32,7 @@ set-option global indentwidth 4 set-option global scrolloff 3,3 define-command -override tree-sitter-user-after-highlighter %{ - add-highlighter -override buffer/show-matching show-matching + add-highlighter -override buffer/show-matching show-matching # add-highlighter -override buffer/bracket regex [\[\]\(\)\{\}]{1} 0:rgb:737373 } @@ -44,24 +44,28 @@ define-command -override tree-sitter-user-after-highlighter %{ add-highlighter global/ number-lines -hlcursor -relative -separator " " add-highlighter global/ show-whitespaces -lf "" -tab "" -only-trailing add-highlighter global/ show-matching -add-highlighter global/wrap wrap -word -indent +# add-highlighter global/wrap wrap -word -indent declare-user-mode ui map -docstring "UI" global user u ": enter-user-mode ui" define-command ui-wrap-enable -docstring "enable wrap" %{ - add-highlighter window/wrap wrap -word -indent - echo -markup "{Information}wrap enabled" + add-highlighter window/wrap wrap -word -indent + echo -markup "{Information}wrap enabled" } define-command ui-wrap-disable -docstring "disable wrap" %{ - remove-highlighter window/wrap - echo -markup "{Information}wrap disabled" + remove-highlighter window/wrap + echo -markup "{Information}wrap disabled" } -hook global WinCreate %{ - add-highlighter window/wrap wrap -word -indent +define-command -override ui-wrap-toggle -docstring "toggle wrap" %{ + try %{ ui-wrap-enable } catch %{ ui-wrap-disable } +} +map -docstring "Wrap UI" global ui w ": ui-wrap-toggle" +hook global WinCreate .* %{ + ui-wrap-enable } map -docstring "yank the selection into the clipboard" global user y " wl-copy" @@ -84,6 +88,14 @@ map -docstring "goto next buffer" global user i ": bn" map global normal _ map -docstring "commenct line" global normal ":comment-line" +define-command open_yazi %{ + nop %sh{ + rm -f /tmp/yazi-path + } + terminal yazi %val{buffile} --chooser-file=/tmp/yazi-path + edit %sh{cat /tmp/yazi-path} +} +map -docstring "open file in yazi" global user ": open_yazi" declare-user-mode git map -docstring "git" global user g ": enter-user-mode git"