A blink.cmp
source that provides
completions for NPM packages and versions in package.json
files.
This plugin is an adaptation of cmp-npm
,
modified to work natively with blink.cmp
.
Add the plugin to your packer manager and make sure it is loaded before blink.cmp
.
Using lazy.nvim
{
"saghen/blink.cmp",
dependencies = { "alexandre-abrioux/blink-cmp-npm.nvim" },
opts = {
sources = {
default = {
-- enable "npm" in your sources list
"npm"
},
providers = {
-- configure the provider
npm = {
name = "npm",
module = "blink-cmp-npm",
async = true,
-- optional - make blink-cmp-npm completions top priority (see `:h blink.cmp`)
score_offset = 100,
-- optional - blink-cmp-npm config
---@module "blink-cmp-npm"
---@type blink-cmp-npm.Options
opts = {
ignore = {},
only_semantic_versions = true,
only_latest_version = false,
}
},
},
},
},
},
Option | Type | Default | Description |
---|---|---|---|
ignore |
string[] |
{} |
Ignore versions that match any of these strings. |
only_semantic_versions |
boolean |
true |
Ignore versions that do not match semantic versioning. |
only_latest_version |
boolean |
false |
When suggesting versions, only show the latest. |
Once installed and enabled,
completions will automatically be provided when working with package.json
files.
Contributions are welcome! Feel free to submit a Pull Request.
Special thanks to:
- @David-Kunz for his work on
cmp-npm
🙏 - @Saghen for creating and maintaining
blink.cmp
🚀