Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a wordlist to vim spell

I have a really long list of (chemistry) words that I want to add to the vim spell checking file. To do this it looks like the best way is to get the english dictionary (I used the .oxt from libreoffice for the en_US.dic and en_US.aff files) and then do (in the directory with these three files):

:mkspell ./chemdic chemistry.dic en_US

but no matter how I try it seems I always get an error about an invalid region in a file. Sometimes it is in the first argument, sometimes in the second and if I use the --ascii option it gives the E755 in regards to the output file (which makes no sense to me).

Please help?

like image 662
user882355 Avatar asked Aug 23 '26 07:08

user882355


1 Answers

I've run across the same issue when generating a dictionary from cs_CZ hunspell dictionaries. I've managed to solve it with the following:

# go to directory with cs_CZ.aff and cs_CZ.dic files
cd /usr/share/hunspell
# convert into cs.spl
env LANG=cs_CZ.utf-8 vim -u NONE -e -c "mkspell! $HOME/.vim/spell/cs cs_CZ" -c q

I think this can be adjusted for custom wordlists, but I did not try it...

like image 103
Jakub Klinkovský Avatar answered Aug 26 '26 23:08

Jakub Klinkovský



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!