vim-DetectSpellLang
vim-DetectSpellLang copied to clipboard
Guessing second tongue other than English installed
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
Hello, thank you for your kind suggestion. I hope it works as intended.