4

I recently started looking at completions, and it says in the help if I am in insert mode and press CTRL+X CTRL+T I should be able to bring up a thesaurus of other words in a drop-down completion, but it just says thesaurus option is empty.

How do I set my thesaurus option, and can I do the same thing for the dictionary?

  • It says there's an example file at: ftp://ftp.ox.ac.uk/pub/wordlists/ but I don't see any host there. – leeand00 Jan 28 '17 at 1:54
3

it just says thesaurus option is empty.

To use the thesaurus in vim, option thesaurus has to be defined in .vimrc, pointing to the location of the thesaurus text file.

Use

set thesaurus+=<file>.txt * Replace <file> with the file location


You can define your own thesaurus using

Steps :

  1. touch thesaurus.txt
  2. write important,valuable,substantial,significant inside it and :wq
  3. link to the file in .vimrc using set thesaurus+=/home/thesaurus.txt
  4. enjoy your newly created thesaurus using Ctrl+x Ctrl+t

But...but...

Making thesaurus for every word is so laborious which is why you can download a thesaurus like Moby thesaurus which has about 20 synonyms for every word!

Alternate link to moby word.txt

link it to .vimrc and enjoy

  • this file isn't exactly in the format vim wants; vim thinks every word in a phrase is a different entry – Andrew Jul 28 '17 at 20:42

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.