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

Download the zip file from the OPTED website and unzip it. (Use unzip -aa or other means to ensure that the text files contain the correct newline format for your machine.) This produces a directory v003 containing many HTML files. Since v003 is not a distinctive name, you may want to rename the directory. We will refer to this directory as the OPTED directory, whatever its actual name.

Put the file opted.vim in one of your Vim plugin directories, e.g., ~/.vim/plugin. In your .vimrc or in a plugin file, let the global variable g:opted_dir contain the location of the OPTED directory, e.g.,

let g:opted_dir = '/home/ds26/opted/v003' 

If you don't explicitly set g:opted_dir yourself, it will be assumed to be ~/v003. I.e., the plugin will assume that you unpacked the OPTED zip file in your home directory and didn't rename 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: Friday, March 26th, 2004 US/Eastern
HTML conversion by TeX2page 2003-11-08