Skip to content

Add configuration thesaurusfunc (similar to omnifunc) #8950

@mcepl

Description

@mcepl

Thesaurus is a very useful function for anybody who wants to write a longer text. Vim's support for this functionality is rudimentary at best and it has plenty of shortcomings. These two Reddit posts lists some of them (while discussing using Mobby Thesaurus as a source of data):

  1. mthesaur.txt contains whole phrases as synonyms - eg 'under the weather' for 'down'. Vim then suggests 'under', 'the' and 'weather' as seperate matches.

  2. Because of the way Vim finds auto-complete matches, the suggestions sometimes number upwards of 10,000 making it really unusable.

  3. Vim can't accept lines longer than 512 characters. Since each entry in mthesaur.txt is one line, they can contain many thousands of characters.

There are some Vim plugins which are dealing with some of these problems (e.g., https://github.com/Ron89/thesaurus_query.vim, https://github.com/reedes/vim-lexical.git), but unfortunately the first thing they have to do is to completely ignore built-in thesaurus in vim (i_CTRL-X_CTRL-T), because this key combination is hardcoded.

Example of omnifunc, where lively ecosystem of completion engines flourishes, and the negative example of both thesaurus and spellchecking, which are limited to the limited built-in implementations (I just have to mention my old PR #2500 and yes, in the end, it seems to me that the original solution before the built-in spellchecker was added could be better if better integrated and/or some simple spelling engine was included).

Some of these issues were mentioned in #1611 but they were mostly ignored so far.

There are some heroic efforts to make the built-in thesaurus working, but none of them seem to be able to overcome the problems in the built-in implementaiton.

Describe the solution you'd like
Introduce configuration settings thesaurusfunc (and possibly even spellsfunc) with the similar syntax to omnifunc, which would allow using external engine for thesaurus functionality.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions