Giter Site home page Giter Site logo

thesauri's Introduction

Thesauri

Homepage

This is a simple plugin that integrates an external thesaurus file into vim's user completion function mechanism. I wrote it because I was unhappy with vim's default thesaurus (see :help 'thesaurus'), which dealt poorly with all of the plain-text thesaurus word lists I could find online. Starting from the excellent (albeit perhaps overly comprehensive) Moby Project's thesaurus, I tried to come up with a way to get it into vim with minimal modifications.

Unfortunately their file uses ancient Mac line endings that make it a pain to grep through. You can use the following Perl command to fix the line endings in the Moby thesaurus, but be sure to redirect it unless you like 24mb of text dumped into your terminal.

perl -ple 's/\r?\n|\r/\n/g' mobythes.aur > newfile

The resulting file is happily processed by both GNU grep and Microsoft's findstr.exe, and hopefully other grep utilities too. Any other method that converts line endings to Unix should also be sufficient to make it usable.

When you have your thesaurus file processed, store it somewhere safe and point g:mobythesaurus_file at it like so:

let g:mobythesaurus_file = $HOME . "/.vim/mobythesaur-vim.txt"

It'd probably also be helpful to set completefunc to CompleteThesauri so that you can actually use the function, like so:

set completefunc=CompleteThesauri

Once everything is set up, you can invoke thesaurus completion via your user completion hotkey, Ctrl-x Ctrl-u by default. This leaves the default thesaurus functionality untouched, in case you use it for other purposes.

As the included LICENSE file indicates, this plugin is released under the GPLv2 license.

thesauri's People

Contributors

tomku avatar

Stargazers

Nazeeruddin Ikram avatar

Watchers

 avatar  avatar James Cloos avatar

Forkers

chew-z

thesauri's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.