opted.vim, a Vim plugin for consulting Webster’s Unabridged Dictionary (1913)

 Dorai Sitaram 
 Download 

The Online Plain Text English Dictionary, or OPTED [3], can be consulted from the text editor Vim [1] quite easily. The OPTED is a public-domain dictionary based on the etext compiled by Project Gutenberg [2] from the 1913 version of Webster’s Unabridged Dictionary. It has about 180,000 entries.

Installation

Put the file opted.vim in one of your Vim plugin directories, e.g., ~/.vim/plugin.

That’s it.

Usage

From Vim, you may now use the command gm to open up a small (5-line) Vim window into the OPTED.

The OPTED window as seen in Vim is the result of massaging the original OPTED files into Vim-suitable .txt and tags files. This massaging is a time-consuming process, but it need be done only once, and thus happens only the first time gm is called. (To avoid an unseemly delay when you try to consult the dictionary for the very first time from Vim, you could pre-build the .txt and tags files by calling vim ‑c "norm gm" ‑c q from your operating system’s command line.)

Once in the OPTED window, you may use any of Vim’s several tags commands to specify a dictionary headword as a tag. E.g.,

:tj lexicon 

or

:tj /lexicon 

The Vim command :help tags shows you the various ways to do tag search in Vim. Vim allows both completion and regular expressions on tags, so you don’t have to have the spelling down pat. Jumping to the tag will show the definition of the headword. You can also browse around the thus-obtained definition using normal Vim navigation commands.

References

[1]   Bram Moolenaar. The VIM (Vi IMproved) Home Page.

[2]   Project Gutenberg.

[3]   Ralph S. Sutherland. The Online Plain Text English Dictionary.

Last modified: Saturday, August 23rd, 2014 9:10:58pm