diff --git a/.config/kak/autoload/helix-scroll.kak b/.config/kak/autoload/helix-scroll.kak new file mode 100644 index 00000000..b5b7a8cb --- /dev/null +++ b/.config/kak/autoload/helix-scroll.kak @@ -0,0 +1,13 @@ +declare-option -hidden int helix_up_line +define-command -hidden helix-up %{ + set-option window helix_up_line %val{cursor_line} + execute-keys + evaluate-commands %sh{ + if [ "$kak_cursor_line" = "$kak_opt_helix_up_line" ]; then + echo "execute-keys gg" + else + echo "nop" + fi + } +} +map -docstring 'helix scroll up' global normal ": helix-up" diff --git a/.config/kak/kakrc b/.config/kak/kakrc index 2bd28ba6..aba21e24 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -18,6 +18,7 @@ define-command trampoline -docstring "open a tutorial" %{ } } +# This gets overridden by editorconfig but we set sane default anyways set-option global tabstop 4 set-option global indentwidth 4 @@ -25,14 +26,12 @@ 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/bracket regex [\[\]\(\)\{\}]{1} 0:rgb:737373 } -# define-command -override tree-sitter-use-after-highlighter %{ -# add-highlighter -override window/bracket regex [\[\]\(\)\{\}]{1} 0:red -# } -# add-highlighter global/bracket regex [\[\]\(\)\{\}]{1} 0:red +# make brackets gray a-la Ashen add-highlighter global/bracket regex [\[\]\(\)\{\}]{1} 0:rgb:737373 +# special highlighting for escaped goodies in regex +add-highlighter global/regex-escaped regex \\[\[\]\(\)\{\}fnrtv0\\dwshDWSH] 0:rgb:e5e5e5 add-highlighter global/ number-lines -hlcursor -relative -separator " " add-highlighter global/ show-whitespaces -lf "" -tab "" -only-trailing add-highlighter global/ show-matching @@ -43,17 +42,15 @@ 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 normal = + echo -markup "{Information}wrap enabled" } -defin-buffere-command ui-wrap-disable -docstring "disable wrap" %{ -defin-buffere-command ui-wrap-disable -docstring "disable wrap" %{ +define-command ui-wrap-disable -docstring "disable wrap" %{ remove-highlighter window/wrap - echo -markup "{Information}wrap normal = + echo -markup "{Information}wrap disabled" } -defin-buffere-command -override ui-wrap-toggle -docstring "toggle wrap" %{ -defin-buffere-command -override ui-wrap-toggle -docstring "toggle wrap" %{ +define-command -override ui-wrap-toggle -docstring "toggle wrap" %{ try %{ ui-wrap-enable } catch %{ ui-wrap-disable } } map -docstring "toggle soft wrap" global ui w ": ui-wrap-toggle" @@ -109,7 +106,10 @@ map -docstring "quit" global user q ": q" map -docstring "quit" global normal ": q" map -docstring "quit" global user Q ": q!" map -docstring "quit" global normal ": q!" -map -docstring "save" global normal ": w" +map -docstring "save" global normal ": write" +map -docstring "save" global normal ": write!" +# map -docstring "save" global normal ": write-all" +# map -docstring "save" global normal ": write-all!" map -docstring "close current buffer" global user x ": db" @@ -161,28 +161,15 @@ map -docstring 'case insensitive backward extend-search' global user '' # map -docstring 'Select previous menu' global prompt -hook global InsertCompletionShow .* %{ - map window insert - map window insert - hook -once window InsertCompletionHide .* %{ - unmap window insert - unmap window insert - } -} +# hook global InsertCompletionShow .* %{ +# map window insert +# map window insert +# hook -once window InsertCompletionHide .* %{ +# unmap window insert +# unmap window insert +# } +# } map -docstring 'Select to file end' global user N "GjL" map -docstring 'Extend to file end' global user n "gjl" -declare-option -hidden int helix_up_line -define-command -hidden helix-up %{ - set-option window helix_up_line %val{cursor_line} - execute-keys - evaluate-commands %sh{ - if [ "$kak_cursor_line" = "$kak_opt_helix_up_line" ]; then - echo "execute-keys gg" - else - echo "nop" - fi - } -} -