Skip to content

archie-judd/blink-cmp-words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blink Completion Words

Fuzzy complete words and synonyms using blink-cmp.

What is Blink Completion Words?

blink-cmp-words is an extension for blink-cmp that can be used in two ways:

  1. As a dictionary - provides word completion with definitions and related terms
  2. As a thesaurus - provides synonym completion for finding alternative words

It uses Princeton University's WordNet lexical database to provide words, definitions and lexical relations.

thesaurus-demo.webm

Getting Started

Dependencies

Installation

Using lazy.nvim:

{
	"saghen/blink.cmp",
	dependencies = { "archie-judd/blink-cmp-words" },
	opts = {
		-- ...
		-- Optionally add 'dictionary', or 'thesaurus' to default sources
		sources = {
			default = { "lsp", "path", "lazydev" },
			providers = {

				-- Use the thesaurus source
				thesaurus = {
					name = "blink-cmp-words",
					module = "blink-cmp-words.thesaurus",
					-- All available options
					opts = {
						-- A score offset applied to returned items. 
						-- By default the highest score is 0 (item 1 has a score of -1, item 2 of -2 etc..).
						score_offset = 0,

						-- Default pointers define the lexical relations listed under each definition,
						-- see Pointer Symbols below.
						-- Default is as below ("antonyms", "similar to" and "also see").
						definition_pointers = { "!", "&", "^" },

                        -- The pointers that are considered similar words when using the thesaurus,
                        -- see Pointer Symbols below.
                        -- Default is as below ("similar to", "also see" }
                        similarity_pointers = { "&", "^" },

                        -- The depth of similar words to recurse when collecting synonyms. 1 is similar words, 
                        -- 2 is similar words of similar words, etc. Increasing this may slow results. 
                        similarity_depth = 2,
					},
				},

				-- Use the dictionary source
				dictionary = {
					name = "blink-cmp-words",
					module = "blink-cmp-words.dictionary",
					-- All available options
					opts = {
						-- The number of characters required to trigger completion. 
						-- Set this higher if completion is slow, 3 is default.
						dictionary_search_threshold = 3,

						-- See above
						score_offset = 0,

						-- See above
						definition_pointers = { "!", "&", "^" },
					},
				},
			},

			-- Setup completion by filetype
			per_filetype = {
				text = { "dictionary" },
				markdown = { "thesaurus" },
			},
		},
		-- ...
	},
	-- ...
}

You must specify the exact source module: blink-cmp-words.dictionary or blink-cmp-words.thesaurus, not just blink-cmp-words.

Pointer symbols

A WordNet definition looks like this:

Screenshot From 2025-06-23 19-10-45

Beneath each definition are pointers. A pointer is a lexical relation between words, for example antonyms. You can define which pointers are shown by providing a list of pointer symbols.

See here for more information on pointers. The complete list of pointer symbols is given here:

Symbol Meaning
! Antonym
@ Hypernym
@i Instance Hypernym
~ Hyponym
^ Also see
~i Instance Hyponym
#m Member holonym
#s Substance holonym
#p Part holonym
%m Member meronym
%s Substance meronym
%p Part meronym
= Attribute
* Entailment
$ Verb Group
+ Derivationally related form
;c Domain of synset - TOPIC
-c Member of this domain - TOPIC
;r Domain of synset - REGION
-r Member of this domain - REGION
;u Domain of synset - USAGE
-u Member of this domain - USAGE
> Cause
& Similar to
< Participle of verb
\\ Derived from adjective

Acknowledgements

This plugin uses and includes:

  • The fzy-lua library by swarn, licensed under the MIT License.
  • The WordNet 3.0 database, Copyright 2006 by Princeton University. All rights reserved. WordNet is used under the terms of the WordNet License.

For licenses, see: LICENSE.

Related projects

About

A fast and offline word and synonym completion provider for Neovim

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •