diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak index 2d1ae7db..ec7ba441 100644 --- a/.config/kak/autoload/lsp.kak +++ b/.config/kak/autoload/lsp.kak @@ -153,8 +153,6 @@ hook -group lsp-filetype-python global BufSetOption filetype=python %{ remove-hooks global lsp-filetype-latex hook -group lsp-filetype-latex global BufSetOption filetype=latex %{ - declare-option str foobartest %{ - } set-option buffer lsp_servers %{ [ltex-ls-plus] root_globs = [".git", ".hg", "main.tex"] @@ -192,8 +190,8 @@ hook -group lsp-filetype-latex global BufSetOption filetype=latex %{ """, ] } - # require-module ltex-dict - # ltex-dict-set + require-module ltex-dict + ltex-dict-set define-command -docstring 'Add selection to ltex-ls dictionary' ltex-add %{ set-option buffer lsp_servers %sh{ printf %s "$kak_opt_lsp_servers" | kak -f "$(printf 'dictionary =s\\[.*\\]]_a, "%s"' "$kak_selection")" diff --git a/.config/kak/autoload/ltex-dict.kak b/.config/kak/autoload/ltex-dict.kak index 417bb357..a6565290 100644 --- a/.config/kak/autoload/ltex-dict.kak +++ b/.config/kak/autoload/ltex-dict.kak @@ -1,20 +1,18 @@ provide-module ltex-dict %~ declare-option str ltex_dict_path %exp{%val{config}/ltex-dict.txt} - declare-option -hidden str ltex_tomlize %{ - '%Zbi"a"zr,x_i[a]' - } define-command ltex-dict-set %{ - # declare-option str foobartest '' set-option buffer lsp_servers %sh{ - # printf %s "$kak_opt_lsp_servers" | sed - list="$(cat "$kak_opt_ltex_dict_path" | kak -f '%Zbi\"a\"zr,x_i[a]')" - notify-send "$list" - # cat /tmp/lspconf.txt | sed "/^\s*dictionary =/ s/\[\]/$list/g" + list="$(cat "$kak_opt_ltex_dict_path" | kak -f '%Zbi\"a\"zr,x_i[a]')" echo "$kak_opt_lsp_servers" | sed "/^\s*dictionary =/ s/\[\]/$list/g" } - echo -debug %opt{lsp_servers} - # echo -debug %opt{foobartest} + } + define-command ltex-add %{ + evaluate-commands %sh{ + if [ "$kak_selection_length" = 1 ]; then + printf 'execute-keys bw_tee -a /tmp/test.txt' + + } } ~ diff --git a/.config/kak/ltex-dict.txt b/.config/kak/ltex-dict.txt index e991f949..b2240848 100644 --- a/.config/kak/ltex-dict.txt +++ b/.config/kak/ltex-dict.txt @@ -1,4 +1,3 @@ foobartest apple SonarAuth -