Skip to content

Commit 81129bf

Browse files
added blink-dictionary
1 parent 119b16d commit 81129bf

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

dictionary/markdown-claude.dict

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/openspec:proposal
2+
/openspec:apply
3+
/openspec:archive

dictionary/markdown.dict

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Conner
2+
Ohnesorge

dictionary/words.dict

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ohnesorge

lua/plugins/blink-cmp-plugin.lua

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ return {
22
"saghen/blink.cmp",
33
version = 'v1.2.0',
44
dependencies = {
5-
{ 'echasnovski/mini.nvim', version = false }
5+
{ 'echasnovski/mini.nvim', version = false },
6+
{
7+
'Kaiser-Yang/blink-cmp-dictionary',
8+
dependencies = { 'nvim-lua/plenary.nvim' }
9+
}
610
},
711
---@module 'blink.cmp'
812
---@type blink.cmp.Config
@@ -13,14 +17,34 @@ return {
1317
},
1418
},
1519
sources = {
16-
default = { "path", "lsp", "snippets", "buffer", "lazydev" },
20+
default = { "dictionary", "path", "lsp", "snippets", "buffer", "lazydev" },
1721

1822
providers = {
1923
-- dont show LuaLS require statements when lazydev has items
2024
lsp = {
2125
fallbacks = { "path", "buffer", "snippets" },
2226
},
2327
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", fallbacks = { "lsp" } },
28+
dictionary = {
29+
module = 'blink-cmp-dictionary',
30+
name = 'Dict',
31+
-- Make sure this is at least 2.
32+
-- 3 is recommended
33+
min_keyword_length = 3,
34+
opts = {
35+
dictionary_files = function()
36+
if vim.bo.filetype == 'markdown' then
37+
local bufname = vim.api.nvim_buf_get_name(0)
38+
if bufname:match("^/tmp/claude%-prompt%-.+%.md$") then
39+
return { vim.fn.expand('~/.config/nvim/dictionary/markdown-claude.dict') }
40+
end
41+
return { vim.fn.expand('~/.config/nvim/dictionary/markdown.dict') }
42+
end
43+
return { vim.fn.expand('~/.config/nvim/dictionary/words.dict') }
44+
end,
45+
-- options for blink-cmp-dictionary
46+
}
47+
}
2448
},
2549
},
2650
enabled = function()

0 commit comments

Comments
 (0)