18 lines
596 B
Text
18 lines
596 B
Text
provide-module ltex-dict %~
|
|
|
|
declare-option str ltex_dict_path %exp{%val{config}/ltex-dict.txt}
|
|
define-command ltex-dict-set %{
|
|
set-option buffer lsp_servers %sh{
|
|
list="$(cat "$kak_opt_ltex_dict_path" | kak -f '<a-o>%<a-J>Zbi\"<esc>a\"<esc>z<a-,>r,x_i[<esc>a]<esc>')"
|
|
echo "$kak_opt_lsp_servers" | sed "/^\s*dictionary =/ s/\[\]/$list/g"
|
|
}
|
|
}
|
|
define-command ltex-add %{
|
|
evaluate-commands %sh{
|
|
if [ "$kak_selection_length" = 1 ]; then
|
|
printf 'execute-keys bw_<a-|>tee -a /tmp/test.txt'
|
|
|
|
}
|
|
}
|
|
|
|
~
|