vim-DetectSpellLang icon indicating copy to clipboard operation
vim-DetectSpellLang copied to clipboard

Guessing second tongue other than English installed

Open Kamilcuk opened this issue 1 year ago • 1 comments

Hi, I understand that detectspelllang is guessing the available hunspell or aspell dictionaries.

But every time I enter vim it tells me about it.

Could it do it silently?

I have written vimscript parsing for extracting dicts:

        if executable("aspell")
          let aspell_dicts = systemlist("aspell dicts")
          let aspell_dicts = uniq(map(aspell_dicts, {key, val -> substitute(val, '-[^\n]*', '', '')}))
          let g:detectspelllang_program = "aspell"
          let g:detectspelllang_langs = { "aspell": aspell_dicts }
        else
          let output = system("env LC_ALL=C LANG=C hunspell -D")
          let output = substitute(
               \ output,
                \ '.*AVAILABLE DICTIONARIES[^\n]*\n\(.*\)[^\n]*\(LOADED DICTIONARIES.*\|$\)',
               \ '\1',
               \ '')
          let hunspell_dicts = map(split(output), {key, val -> substitute(val, ".*\/", "", "")})
          let g:detectspelllang_program = "hunspell"
          let g:detectspelllang_langs = { "hunspell": hunspell_dicts }
        endif

Kamilcuk avatar Jun 10 '24 14:06 Kamilcuk

Hello, thank you for your kind suggestion. I hope it works as intended.

Konfekt avatar Jun 10 '24 14:06 Konfekt