I found a plugin that makes web calls to provide a thesaurus, and I also found instructions to use thesaurus-files with Vim, but I wanted to ask if anyone knows if Vim comes with a thesaurus file? Where can we find a nice, mostly complete English thesaurus file, so that I don't need to use an internet-dependent plugin? I see no reason to use a local file on disk for this unless it is more than a few hundred megabytes.

Incidentally I am exploring this topic because I discovered that the thesaurus helps a lot for creating sensible variable names. One day I chased a strange bug for a while and discovered by declaring function process that I overwrote this global variable and it broke the world. That was a nice little lesson and today I just tried to write another variable and name it process and it made me want to use a thesaurus.

Anyhow, I digress. I am a programmer but having a thesaurus is a feature that word processor folks have had figured out for a while because I used it a lot in my middle school essay-writing days.

Here is a potential wrinkle that I can foresee though. If a good proper thesaurus is really big, and if the Vim implementation is a bit naive it is possible that loading a big thesaurus file might bloat up the running Vim processes. I'd rather not do that and it may make sense to fall back to the online plugin depending on this.

  • 2
    How about any of these? – Martin Tournoij Mar 6 '16 at 22:43
  • Mmmm, the only one of those that looks relevant is the one on github which I independently found. The first link in my first sentence. It would appear that the best available option for now is the one I have just made an answer for. – Steven Lu Mar 6 '16 at 22:44

I thought about it and I think that this answer sufficiently addresses my concerns.

It will use the web service and if it fails it will use a local mthesaur.txt fallback. It appears to provide a interface with sufficient usability.

  • Note that the plugin on the referenced answer was already mentioned on the first comment above. – mMontu Mar 9 '16 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.