From 5ac403ab7f768377ec386115532ded8506e632e6 Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Sat, 17 Aug 2024 21:55:20 +0200 Subject: [PATCH] kak: made the switch from plug.kak to bundle.kak --- config/kak/colors/dabruin.kak | 2 +- config/kak/kakrc | 107 +++++++++++++------------- config/kak/plugins/bookmarks.kak | 1 - config/kak/plugins/dabruin.kak | 1 - config/kak/plugins/foot.kak | 1 - config/kak/plugins/kak-harpoon | 1 - config/kak/plugins/kakoune-find | 1 - config/kak/plugins/kakoune-sudo-write | 1 - config/kak/plugins/kakship | 1 - config/kak/plugins/plug.kak | 1 - config/kak/plugins/smarttab.kak | 1 - config/kak/starship.toml | 14 ++-- 12 files changed, 63 insertions(+), 69 deletions(-) delete mode 160000 config/kak/plugins/bookmarks.kak delete mode 160000 config/kak/plugins/dabruin.kak delete mode 160000 config/kak/plugins/foot.kak delete mode 160000 config/kak/plugins/kak-harpoon delete mode 160000 config/kak/plugins/kakoune-find delete mode 160000 config/kak/plugins/kakoune-sudo-write delete mode 160000 config/kak/plugins/kakship delete mode 160000 config/kak/plugins/plug.kak delete mode 160000 config/kak/plugins/smarttab.kak diff --git a/config/kak/colors/dabruin.kak b/config/kak/colors/dabruin.kak index da4a46bd..29f6e2df 120000 --- a/config/kak/colors/dabruin.kak +++ b/config/kak/colors/dabruin.kak @@ -1 +1 @@ -../plugins/dabruin.kak/dabruin.kak \ No newline at end of file +/home/andy/.config/kak/bundle/dabruin.kak \ No newline at end of file diff --git a/config/kak/kakrc b/config/kak/kakrc index 69be1fb3..497ad4e0 100644 --- a/config/kak/kakrc +++ b/config/kak/kakrc @@ -22,6 +22,7 @@ hook global NormalKey y %{ nop %sh{ # ────────────────────────────────────────────────────────────────────────────── hook global BufOpenFile .* %{ modeline-parse + editorconfig-load } hook global BufCreate [^*].* %{ @@ -31,6 +32,9 @@ hook global BufCreate [^*].* %{ } } +hook global BufNewFile .* %{ + editorconfig-load +} # dynamic scrolloff # ────────────────────────────────────────────────────────────────────────────── @@ -51,36 +55,34 @@ evaluate-commands %sh{ kks init } - # Enable PLUGin manager # ────────────────────────────────────────────────────────────────────────────── -source "%val{config}/plugins/plug.kak/rc/plug.kak" -plug "andreyorst/plug.kak" noload - plug "Ersikan/bookmarks.kak" %{ - hook global WinCreate .* bookmarks-enable - } - plug "andreyorst/smarttab.kak" defer smarttab %{ - # when 'backspace' is pressed, 4 spaces are deleted at once - set-option global softtabstop 4 - } config %{ - hook global WinSetOption filetype=(rust|markdown|kak|lisp|scheme|py|sh|perl) expandtab - hook global WinSetOption filetype=(makefile|gas) noexpandtab - hook global WinSetOption filetype=(c|cpp) smarttab - } - plug "occivink/kakoune-sudo-write" - plug "occivink/kakoune-find" - plug "foot.kak" - plug "https://git.sr.ht/~nasmevka/dabruin.kak" noload - plug "eburghar/kakship" do %{ - cargo install --force --path . --root ~/.local +source "%val{config}/bundle/kak-bundle/rc/kak-bundle.kak" +bundle-noload kak-bundle https://codeberg.org/jdugan6249/kak-bundle +bundle kakoune-sudo-write https://github.com/occivink/kakoune-sudo-write +bundle kakoune-find https://github.com/occivink/kakoune-find +bundle kakoune-expand https://github.com/occivink/kakoune-expand +bundle foot.kak https://github.com/kkga/foot.kak +bundle kak-harpoon https://github.com/raiguard/kak-harpoon %{ + hook global WinCreate .* harpoon-add-bindings +} +bundle kakship https://github.com/eburghar/kakship %{ + kakship-enable +} + bundle-install-hook kakship %{ + cargo install --force --path . --root ~/.local [ ! -e $kak_config/starship.toml ] && cp starship.toml $kak_config/ - } config %{ - kakship-enable } - plug "raiguard/kak-harpoon" %{ - hook global WinCreate .* harpoon-add-bindings +bundle-noload dabruin.kak https://git.sr.ht/~nasmevka/dabruin.kak + bundle-install-hook dabruin.kak %{ + mkdir -p ${kak_config}/colors + ln -sf "${kak_opt_bundle_path}/dabruin.kak" "${kak_config}/colors/" + ln -sf "${kak_opt_bundle_path}/dabruin-light.kak" "${kak_config}/colors/" + } + bundle-cleaner dabruin.kak %{ + rm -f "${kak_config}/colors/dabruin.kak" + rm -f "${kak_config}/colors/dabruin-light.kak" } - # Enable some linting and formatting # ────────────────────────────────────────────────────────────────────────────── @@ -126,23 +128,23 @@ add-highlighter global/trailing-whitespace regex '\h+$' 0:Error add-highlighter global/todos regex '(//|#|/\*)\h*(TODO|WARNING|FIXME)[:]?[^\n]*' 2:+bu # highlight comment tags add-highlighter global/ show-matching # show matching brackets add-highlighter global/ number-lines -hlcursor -min-digits 3 # absolute line nums everywhere -declare-option str dabruin_accent 'rgb:A1B56C' -declare-option str dabruin_background 'rgb:242124' +# declare-option str dabruin_accent 'rgb:A1B56C' +# declare-option str dabruin_ratio '-3/5' colorscheme dabruin -set-option global tabstop 4 -set-option global indentwidth 4 +# set-option global tabstop 4 +# set-option global indentwidth 4 add-highlighter global/ wrap -word -indent # Different Cursor color in insert mode # ────────────────────────────────────────────────────────────────────────────── # Shades of green/yellow for insert mode. hook global ModeChange (push|pop):.*:insert %{ - set-face window StatusLine black,blue + set-face window StatusLine black,yellow } # Undo colour changes when we leave insert mode. hook global ModeChange (push|pop):insert:.* %{ - unset-face window StatusLine + unset-face window StatusLine } @@ -180,34 +182,35 @@ map global normal -docstring 'Previous buffer' ': buffer-previous' # default user mode # ────────────────────────────────────────────────────────────────────────────── -map global user -docstring 'Buffer mode' b ':enter-user-mode buffermode' -map global user -docstring 'Selection mode' s ':enter-user-mode selectionmode' -map global user -docstring 'edit kakrc' E ': e ~/.config/kak/kakrc' -map global user -docstring 'relative line numbers enable' r ': add-highlighter window/nl number-lines -min-digits 3 -relative -hlcursor' -map global user -docstring 'relative line numbers disable' R ': remove-highlighter window/nl' -map global user -docstring 'decrease value' d ': inc %val{count} -' -map global user -docstring 'increase value' i ': inc %val{count} +' +map global user -docstring '(B)uffer mode' b ': enter-user-mode buffermode' +map global user -docstring '(S)election mode' s ': enter-user-mode selmode' +map global user -docstring '(e)xpand selection' e ': expand' +map global user -docstring '(E)dit kakrc' E ': e ~/.config/kak/kakrc' +map global user -docstring '(r)elative line numbers enable' r ': addhl window/nl number-lines -min-digits 3 -relative -hlcursor' +map global user -docstring '(R)elative line numbers disable' R ': remove-highlighter window/nl' +map global user -docstring '(d)ecrease value' d ': inc %val{count} -' +map global user -docstring '(i)ncrease value' i ': inc %val{count} +' # buffer user mode # ────────────────────────────────────────────────────────────────────────────── declare-user-mode buffermode -map global buffermode -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert' -map global buffermode -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert' -map global buffermode -docstring 'clean tabs and trailing whitespace in the buffer' c ': clean-buffer' -map global buffermode -docstring 'delete buffer' d ': delete-buffer' -map global buffermode -docstring 'buffer picker' l ': kks-connect terminal-popup kks-buffers' -map global buffermode -docstring 'Lint buffer' L ': buffer *lint-output*' -map global buffermode -docstring 'Next buffer ' n ': buffer-next' -map global buffermode -docstring 'Previous buffer' p ': buffer-previous' -map global buffermode -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap' -map global buffermode -docstring 'wrap disable' W ': remove-highlighter buffer/bw' +map global buffermode -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert' +map global buffermode -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert' +map global buffermode -docstring 'clean tabs and trailing whitespaces' c ': clean-buffer' +map global buffermode -docstring 'delete buffer' d ': delete-buffer' +map global buffermode -docstring 'buffer picker' l ': kks-connect terminal-popup kks-buffers' +map global buffermode -docstring 'Lint buffer' L ': buffer *lint-output*' +map global buffermode -docstring 'Next buffer ' n ': buffer-next' +map global buffermode -docstring 'Previous buffer' p ': buffer-previous' +map global buffermode -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap' +map global buffermode -docstring 'wrap disable' W ': remove-highlighter buffer/bw' # selection user mode # ────────────────────────────────────────────────────────────────────────────── -declare-user-mode selectionmode -map global selectionmode -docstring 'clean tabs and trailing whitespace in selections' c ': clean-selections' -map global selectionmode -docstring 'sort words (H)orizontally in selection ' h '| xargs -n1 | sort -u | xargs ' -map global selectionmode -docstring 'sort words (V)ertically in selection ' v '| sort -n ' +declare-user-mode selmode +map global selmode -docstring 'clean tabs and trailing whitespaces' c ': clean-selections' +map global selmode -docstring 'sort words (H)orizontally in selection ' h '| xargs -n1 | sort -u | xargs ' +map global selmode -docstring 'sort words (V)ertically in selection ' v '| sort -n ' # terminal config (via foot.kak) # ────────────────────────────────────────────────────────────────────────────── diff --git a/config/kak/plugins/bookmarks.kak b/config/kak/plugins/bookmarks.kak deleted file mode 160000 index 2e92602e..00000000 --- a/config/kak/plugins/bookmarks.kak +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2e92602eef5ed1717660689765b93583eecce099 diff --git a/config/kak/plugins/dabruin.kak b/config/kak/plugins/dabruin.kak deleted file mode 160000 index f1cc1b1c..00000000 --- a/config/kak/plugins/dabruin.kak +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1cc1b1cfea2a412cd0230e2dc3f2a1140eac4a2 diff --git a/config/kak/plugins/foot.kak b/config/kak/plugins/foot.kak deleted file mode 160000 index 406cbadd..00000000 --- a/config/kak/plugins/foot.kak +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 406cbaddb7daaeb33a308557b4faf94697bcc91a diff --git a/config/kak/plugins/kak-harpoon b/config/kak/plugins/kak-harpoon deleted file mode 160000 index a6d7bd6a..00000000 --- a/config/kak/plugins/kak-harpoon +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a6d7bd6a380a8591d00b6d55595f3fdbd2e65cd5 diff --git a/config/kak/plugins/kakoune-find b/config/kak/plugins/kakoune-find deleted file mode 160000 index 09afcc85..00000000 --- a/config/kak/plugins/kakoune-find +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 09afcc8520d4c92928fe69da4c370b9979aa90d3 diff --git a/config/kak/plugins/kakoune-sudo-write b/config/kak/plugins/kakoune-sudo-write deleted file mode 160000 index ec0d6d26..00000000 --- a/config/kak/plugins/kakoune-sudo-write +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ec0d6d26ceaadd93d6824630ba587b31e442214d diff --git a/config/kak/plugins/kakship b/config/kak/plugins/kakship deleted file mode 160000 index c58d5920..00000000 --- a/config/kak/plugins/kakship +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c58d592051d65d004129185c5f0bb48c11a63801 diff --git a/config/kak/plugins/plug.kak b/config/kak/plugins/plug.kak deleted file mode 160000 index f28b3fb8..00000000 --- a/config/kak/plugins/plug.kak +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f28b3fb88fbc77d69b1027780cb9a16b0bd7fc76 diff --git a/config/kak/plugins/smarttab.kak b/config/kak/plugins/smarttab.kak deleted file mode 160000 index 86ac6599..00000000 --- a/config/kak/plugins/smarttab.kak +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 86ac6599b13617ff938905ba4cdd8225d7eb6a2e diff --git a/config/kak/starship.toml b/config/kak/starship.toml index 5a61b3de..a699d8e5 100644 --- a/config/kak/starship.toml +++ b/config/kak/starship.toml @@ -111,7 +111,7 @@ disabled = false format = "[ $symbol$percentage]($style) " charging_symbol = ' ' discharging_symbol = ' ' -disabled = true +disabled = false [[battery.display]] threshold = 10 @@ -194,12 +194,12 @@ format = '[]($style)[  %val{client}:%val{session} ]($style)[]($style in style = 'bg:yellow fg:black italic' when = '' shell = ['true'] -disabled = false +disabled = true [custom.kakcursor] description = 'The current Kakoune cursor position' format = '[%val{cursor_line}:%val{cursor_char_column}]($style)' -style = 'fg:white' +style = 'fg:bright-white' when = '' shell = ['true'] disabled = false @@ -248,7 +248,7 @@ format = "[  %opt{lsp_diagnostic_error_count}]($style)" style = "red bold" when = '[ -n "$kak_opt_lsp_diagnostic_error_count" -a "$kak_opt_lsp_diagnostic_error_count" -ne 0 ]' shell = ['sh'] -disabled = true +disabled = false [custom.kaklsp_warn] description = "Show warnings number from kak-lsp if any" @@ -256,7 +256,7 @@ format = "[  %opt{lsp_diagnostic_warning_count}]($style)" style = "yellow bold" when = '[ -n "$kak_opt_lsp_diagnostic_warning_count" -a "$kak_opt_lsp_diagnostic_warning_count" -ne 0 ]' shell = ['sh'] -disabled = true +disabled = false [custom.kaklsp_hint] description = "Show hints number from kak-lsp if any" @@ -264,7 +264,7 @@ format = "[ ﯦ %opt{lsp_diagnostic_hint_count}]($style)" style = "white bold" when = '[ -n "$kak_opt_lsp_diagnostic_hint_count" -a "$kak_opt_lsp_diagnostic_hint_count" -ne 0 ]' shell = ['sh'] -disabled = true +disabled = false [custom.kaklsp_code_actions] description = "Show lsp code actions" @@ -280,4 +280,4 @@ format = "[ ]($style)" style = "bright-white bold" when = '[ -n "$kak_opt_lsp_modeline_progress" ]' shell = ['sh'] -disabled = true +disabled = false -- 2.51.2