A Vim/Neovim plugin that provides WordNet-based completions through nvim-cmp, offering synonyms, hyponyms, and meronyms.
- WordNet integration with nvim-cmp for intelligent word suggestions
- Provides:
- Synonyms (words with similar meanings)
- Hyponyms (more specific terms)
- Meronyms (part-of relationships)
- Configurable completion triggers
- Support for both Vim and Neovim
- Python-powered WordNet lookups
- Vim with Python3 support
+python3
or Neovim with Python3 provider - Python 3.8 or higher
- nvim-cmp installed and configured
- Python packages:
wn>=0.10.1
Using vim-plug
Plug 'hrsh7th/nvim-cmp' " Required dependency
Plug 'klebster2/wordnet-cmp'
Using packer.nvim
use {
'klebster2/wordnet-cmp',
requires = {
'hrsh7th/nvim-cmp'
}
}
Using lazy.nvim
{
'klebster2/wordnet-cmp',
dependencies = {
'hrsh7th/nvim-cmp'
}
}
-- Set configuration options (optional)
vim.g.wn_cmp_language = 'en' -- Default language
vim.g.wn_cmp_min_word_length = 3 -- Minimum word length to trigger completion
vim.g.wn_cmp_max_items = 50 -- Maximum number of completion items
-- Add WordNet to nvim-cmp sources
require('cmp').setup({
sources = {
-- Your other sources...
{ name = 'wordnet' }
}
})
" Set configuration options (optional)
let g:wn_cmp_language = 'en'
let g:wn_cmp_min_word_length = 3
let g:wn_cmp_max_items = 50
" Configure nvim-cmp with WordNet source
lua << EOF
require('cmp').setup({
sources = {
-- Your other sources...
{ name = 'wordnet' }
}
})
EOF
The plugin provides completions automatically through nvim-cmp. Start typing a word, and completion suggestions will appear, including:
- Synsets (marked with [NOUN] [VERB] [ADJECTIVE] [ADJECTIVE SATELLITE] [ADVERB])
- Hyponyms (marked with [Hyponym])
- Meronyms (marked with [Meronym])
- Synonyms (marked with [Synonym])
Option | Default | Description |
---|---|---|
g:wn_cmp_language |
'en' | WordNet language (currently only English supported) |
g:wn_cmp_min_word_length |
3 | Minimum word length to trigger completion |
g:wn_cmp_max_items |
50 | Maximum number of completion items to show |
-
Plugin not working
- Ensure Vim/Neovim has Python3 support:
:echo has('python3') " Should return 1
- Check Python packages are installed based on the python vim is using:
python -m pip list | grep -E "wn|nltk|vim-client"
- Ensure Vim/Neovim has Python3 support:
-
No completions appearing
- Verify nvim-cmp is properly configured
- Check the minimum word length setting
- Ensure the WordNet source is registered
- Create an issue explaining the problem
Contributions are welcome! Please feel free to submit a Pull Request.
The same as the VIM license
- wn python library database and resources
- nvim-cmp for the completion engine