Make vim use hunspell?

1,031 views
Skip to first unread message

Metal Heart

unread,
Jan 12, 2016, 12:04:13 PM1/12/16
to vim_use
Hi users and experts,

I am aware vim has it's own spellchecker, and uses .spl files that can be generated by mkspell from hunspell dictionary files.

Here's the thing - I am trying to use same spellchecking files for vim, Libreoffice, and OmegaT (an opensource translation memory system), as I don't want to maintain two sets of dictionaries.

Libreoffice and OmegaT support hunspell dictionaries only.

Is there any chance of either:
- getting vim to read and write hunspell dictionaries (IIRC vim doesn't completely support the format),
- or making vim use the external huspell spellchecker (instead of its internal one)?

I would greatly appreciate any pointers. A systemwide spellchecker would be so useful, especially as I want several colleagues to all use and modify the same directories. It would improve our writing! :-)

Bram Moolenaar

unread,
Jan 12, 2016, 3:15:13 PM1/12/16
to Metal Heart, vim_use

Metal Heart wrote:

> Hi users and experts,
>
> I am aware vim has it's own spellchecker, and uses .spl files that can
> be generated by mkspell from hunspell dictionary files.
>
> Here's the thing - I am trying to use same spellchecking files for
> vim, Libreoffice, and OmegaT (an opensource translation memory
> system), as I don't want to maintain two sets of dictionaries.
>
> Libreoffice and OmegaT support hunspell dictionaries only.
>
> Is there any chance of either:
> - getting vim to read and write hunspell dictionaries (IIRC vim
> doesn't completely support the format),

Vim originally had the goal to support the same file format.
Unfortunately the hunspell developers went ahead and implemented some
weird features, partly including language-specific things in the source
code. And quite a few of the flags are not properly documented, making
it very difficult to follow their file format. It requires reverse
engineering their code.

> - or making vim use the external huspell spellchecker (instead of its
> internal one)?

That would be too slow. Also, the suggestions from Vim are far
superiour (last time I checked, which is quite a while ago).

> I would greatly appreciate any pointers. A systemwide spellchecker
> would be so useful, especially as I want several colleagues to all use
> and modify the same directories. It would improve our writing! :-)

I would invite anyone to work on this.

--
"I've been teaching myself to play the piano for about 5 years and now write
most of my songs on it, mainly because I can never find any paper."
Jeff Lynne, ELO's greatest hits

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Metal Heart

unread,
Jan 13, 2016, 6:04:26 AM1/13/16
to vim_use
-----------------------------------------------------------

Vim originally had the goal to support the same file format.
Unfortunately the hunspell developers went ahead and implemented some
weird features, partly including language-specific things in the source
code. And quite a few of the flags are not properly documented, making
it very difficult to follow their file format. It requires reverse
engineering their code. -----------------------------------------------------------

Bedankt, Mr Moolenaar!

Thank you for the prompt answer and info from the horse's mouth, as it were. :-)
It's nice to see the continuing interest in vim both by developers and users!

Dominique Pellé

unread,
Jan 14, 2016, 12:53:07 AM1/14/16
to Vim List
I remember seeing a patch to support Hunspell in Vim here:

https://bugzilla.redhat.com/show_bug.cgi?id=219777
http://vim.1045645.n5.nabble.com/RFC-use-hunspell-dictionaries-td1201639.html

But it's an old patch, and it was deemed "crude".

James Vega also suggested to use Enchant library instead of Hunspell
a long time ago, which would allow vim to support Hunspell and other
dictionary formats. See:

http://permalink.gmane.org/gmane.editors.vim.devel/30006
http://www.abisource.com/projects/enchant/

I also miss not being to use Hunspell. The vim dictionary for
French uses an old aspell dictionary. More recent French
dictionaries use Hunspell which use features not understood
by Vim.

Regards
Dominique

Metal Heart

unread,
Jan 14, 2016, 1:10:48 PM1/14/16
to vim_use
I did stumble across said Enchant project, but the links quoted above are from 2010/2011, so I'm a bit afraid. Has anybody tried this?

Dominique Pellé

unread,
Jan 14, 2016, 2:07:01 PM1/14/16
to Vim List
Metal Heart <ast...@jekat.com> wrote:

> I did stumble across said Enchant project, but the links quoted above
> are from 2010/2011, so I'm a bit afraid. Has anybody tried this?

The page http://www.abisource.com/projects/enchant/
says that enchant is now on git. It must be this repository:

https://github.com/AbiWord/enchant

Not a lot of activity there, but the last checkin was from Nov 6, 2015.

Dominique
Reply all
Reply to author
Forward
0 new messages