From 62e9b937361b31b86b06012392c67302027759bf Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Tue, 8 Jul 2025 17:40:19 -0400 Subject: [PATCH] AutoYADM commit: 2025-07-08 17:40:19 --- .config/kak/autoload/colemak.kak | 2 + .config/kak/autoload/lsp.kak | 2 + .config/kak/extra.kak | 86 ++++++++++++++++++++++++++++ .config/kak/kakrc | 98 +------------------------------- 4 files changed, 92 insertions(+), 96 deletions(-) create mode 100644 .config/kak/extra.kak diff --git a/.config/kak/autoload/colemak.kak b/.config/kak/autoload/colemak.kak index 300d5b8f..9f2e412b 100644 --- a/.config/kak/autoload/colemak.kak +++ b/.config/kak/autoload/colemak.kak @@ -1,3 +1,4 @@ +provide-module colemak %~ # Colemak-friendly bindings map global normal m "h" @@ -117,3 +118,4 @@ map global normal "" # map global normal "" # map global normal "" +~ diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak index 0d43a879..6d8ec4f1 100644 --- a/.config/kak/autoload/lsp.kak +++ b/.config/kak/autoload/lsp.kak @@ -1,3 +1,4 @@ +provide-module lsp %∴ # load plugin eval %sh{kak-lsp} @@ -371,3 +372,4 @@ hook -group lsp-filetype-sh global BufSetOption filetype=sh %{ } } +∴ diff --git a/.config/kak/extra.kak b/.config/kak/extra.kak new file mode 100644 index 00000000..57bb3f50 --- /dev/null +++ b/.config/kak/extra.kak @@ -0,0 +1,86 @@ +# loading extra configuration that requires dependencies, +# not suitable for remote servers and whatnot + +evaluate-commands %sh{ kak-tree-sitter -dks --init $kak_session } +evaluate-commands %sh{kak-popup init} +# evaluate-commands %sh{ reflow init } +# set-option global reflow_command %{ +# cat > "${input=$(mktemp)}" +# # reflow --width "$kak_opt_reflow_width" --tabstop "$kak_opt_tabstop" < "$input" || cat "$input" +# fmt -u < "$input" | perl -CS -pe 's/([.!?])\s{2,}/\1 /g' || cat "$input" +# rm -f "$input" +# } + +require-module spell +require-module lsp +require-module hop-kak +require-module fishr +require-module title-bar +require-module notes +require-module plugins +require-module yazi +require-module luar +require-module clipboard +set-option global luar_interpreter luajit +# only set to foot if we are on wayland +hook global ModuleLoaded wayland %{ + set-option global termcmd 'footclient dash -c' +} +# needed for tree-sitter to respect show-matching +define-command -override tree-sitter-user-after-highlighter %{ + add-highlighter -override buffer/show-matching show-matching +} + +# manually requiring needed for some reason 😢 +# require-module peneira + +# declare-user-mode peneira +# map -docstring %{ +# Picker mode +# } global user f ': enter-user-mode peneira' +# map -docstring 'pick file' global peneira f ': peneira-files' +# map -docstring 'pick unopened file' global peneira F ': peneira-files -hide-opened' +# map -docstring %{ +# pick line in buffer +# } global peneira '/' ': peneira-lines' +define-command -override -hidden consume %{ + nop %sh{ + niri msg action consume-or-expel-window-left + } +} + +define-command terminal-consume %{ + terminal dash -c 'niri msg action consume-or-expel-window-left; exec fish' +} + +alias global tc terminal-consume + +define-command -docstring %{ + Create a new client in vertial split +} new-consume %{ + new consume +} + +alias global nc new-consume +alias global n new +define-command -docstring 'open popup shell' popup-shell %{ + popup fish +} +alias global pp popup-shell + +map -docstring 'popup shell' global user . ': popup-shell' +require-module ui-mode + +try %{ + evaluate-commands %sh{kak-lsp-diags} + map -docstring 'enable diagnostic hover' global ui "'" ': lsp-diag-hover-enable' + map -docstring 'disable diagnostic hover' global ui '"' ': lsp-diag-hover-disable' +} + +define-command -docstring "New terminal in cwd" cwd-terminal %{ + terminal fish +} +# make easy to open new shell +alias global t cwd-terminal + + diff --git a/.config/kak/kakrc b/.config/kak/kakrc index c7ca48ba..773d575d 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -14,102 +14,26 @@ define-command -override true nop define-command -override false fail require-module ui-mode +require-module colemak try %{ %opt{on_server} colorscheme ashen-local } catch %{ - evaluate-commands %sh{ kak-tree-sitter -dks --init $kak_session } - evaluate-commands %sh{kak-popup init} - # evaluate-commands %sh{ reflow init } - # set-option global reflow_command %{ - # cat > "${input=$(mktemp)}" - # # reflow --width "$kak_opt_reflow_width" --tabstop "$kak_opt_tabstop" < "$input" || cat "$input" - # fmt -u < "$input" | perl -CS -pe 's/([.!?])\s{2,}/\1 /g' || cat "$input" - # rm -f "$input" - # } - colorscheme ashen - require-module hop-kak - require-module fishr - require-module title-bar - require-module notes - require-module plugins - require-module yazi - require-module luar - require-module clipboard - set-option global luar_interpreter luajit - # only set to foot if we are on wayland - hook global ModuleLoaded wayland %{ - set-option global termcmd 'footclient dash -c' - } -# needed for tree-sitter to respect show-matching -define-command -override tree-sitter-user-after-highlighter %{ - add-highlighter -override buffer/show-matching show-matching -} - -# manually requiring needed for some reason 😢 -# require-module peneira - -# declare-user-mode peneira -# map -docstring %{ -# Picker mode -# } global user f ': enter-user-mode peneira' -# map -docstring 'pick file' global peneira f ': peneira-files' -# map -docstring 'pick unopened file' global peneira F ': peneira-files -hide-opened' -# map -docstring %{ -# pick line in buffer -# } global peneira '/' ': peneira-lines' -define-command -override -hidden consume %{ - nop %sh{ - niri msg action consume-or-expel-window-left - } -} - -define-command terminal-consume %{ - terminal dash -c 'niri msg action consume-or-expel-window-left; exec fish' -} - -alias global tc terminal-consume - -define-command -docstring %{ - Create a new client in vertial split -} new-consume %{ - new consume -} - -alias global nc new-consume -alias global n new -define-command -docstring 'open popup shell' popup-shell %{ - popup fish -} -alias global pp popup-shell - -map -docstring 'popup shell' global user . ': popup-shell' -require-module ui-mode - -try %{ - evaluate-commands %sh{kak-lsp-diags} - map -docstring 'enable diagnostic hover' global ui "'" ': lsp-diag-hover-enable' - map -docstring 'disable diagnostic hover' global ui '"' ': lsp-diag-hover-disable' -} + source %exp{%val{config}/extra.kak} } require-module surround require-module expand require-module ficgrep require-module byline -require-module spell set-option global scrolloff 3,3 - - - try %{ set-option global ashen_dynamic_cursor true set-option global ashen_eol_cursor true } - # disable clippy set-option -add global ui_options terminal_assistant=none @@ -225,13 +149,6 @@ define-command -params 1 -docstring "Set buffer filetype" filetype %{ alias global ft filetype alias global lang filetype -define-command -docstring "New terminal in cwd" cwd-terminal %{ - terminal fish -} -# make easy to open new shell -alias global t cwd-terminal - - map global normal '"_' define-command goto-debug %{ buffer *debug* @@ -263,17 +180,6 @@ map -docstring 'save to jumplist' global normal # selection saving map -docstring 'add selection' global normal Y a -# hook -once global ClientCreate .* %{ -# evaluate-commands %sh{ -# if [ "$kak_buflist" != "*debug* *scratch*" ]; then -# echo "delete-buffer *scratch*" -# else -# echo "echo -debug dumping buffers" -# echo "echo -debug %val{buflist}" -# fi -# } -# } - # open URL require-module url-open map -docstring "Open URL" global goto u ': url-open'