From 5e2ea8c9652435850abc2ecf92ffd9dcc65467c3 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Sat, 14 Jun 2025 02:45:38 -0400 Subject: [PATCH] AutoYADM commit: 2025-06-14 02:45:38 --- .config/kak/autoload/lsp.kak | 6 ++++-- .config/kak/autoload/ltex-dict.kak | 9 +++++---- .config/kak/ltex-dict.txt | 4 +--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.config/kak/autoload/lsp.kak b/.config/kak/autoload/lsp.kak index e28dd079..89c26232 100644 --- a/.config/kak/autoload/lsp.kak +++ b/.config/kak/autoload/lsp.kak @@ -154,7 +154,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 %{ - dictionary = { "en-US" = ["builtin", "Fichtinger", "SonarAuth", "sexpenis" ], "en-CA" = ["more", "words"] } } set-option buffer lsp_servers %{ [ltex-ls-plus] @@ -163,7 +162,8 @@ hook -group lsp-filetype-latex global BufSetOption filetype=latex %{ # TODO: write a script where the dictionary is a list of words # that's read from a file and then output in TOML format. # This way we can implement adding our own words to this list dynamically - %opt{foobartest} + # dictionary = { "en-US" = ["builtin", "Fichtinger", "SonarAuth", "sexpenis" ], "en-CA" = ["more", "words"] } + dictionary = { "en-US" = [] } [texlab] root_globs = [".git", ".hg"] @@ -192,6 +192,8 @@ hook -group lsp-filetype-latex global BufSetOption filetype=latex %{ """, ] } + 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 0c14f8f9..f3536594 100644 --- a/.config/kak/autoload/ltex-dict.kak +++ b/.config/kak/autoload/ltex-dict.kak @@ -5,14 +5,15 @@ provide-module ltex-dict %~ '%Zbi"a"zr,x_i[a]' } define-command ltex-dict-set %{ - declare-option str foobartest '' - set-option buffer foobartest %sh{ + # 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]')" # cat /tmp/lspconf.txt | sed "/^\s*dictionary =/ s/\[\]/$list/g" - printf "$kak_opt_lsp_servers" | sed "/^\s*dictionary =/ s/\[\]/$list/g" + echo "$kak_opt_lsp_servers" | sed "/^\s*dictionary =/ s/\[\]/$list/g" } - echo -debug %opt{foobartest} + echo -debug %opt{lsp_servers} + # echo -debug %opt{foobartest} } ~ diff --git a/.config/kak/ltex-dict.txt b/.config/kak/ltex-dict.txt index 72c5265b..e81f79d3 100644 --- a/.config/kak/ltex-dict.txt +++ b/.config/kak/ltex-dict.txt @@ -1,4 +1,2 @@ +foobartest apple -banana -cherry -