Skip to content

Commit

Permalink
feat(group): add support for blink.cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
matharman committed Jan 9, 2025
1 parent 595ffb8 commit e75fd91
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/nightfox/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ M.module_names = {
"alpha",
"aerial",
"barbar",
"blink",
"cmp",
"coc",
"dap_ui",
Expand Down
52 changes: 52 additions & 0 deletions lua/nightfox/group/modules/blink.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-- https://github.com/Saghen/blink.cmp
-- Adapted links and colors from groups/modules/cmp.lua

local M = {}

function M.get(spec, config, opts)
local has_ts = config.modules.treesitter
local syn = spec.syntax

-- stylua: ignore
return {
BlinkCmpDoc = { fg = spec.fg1, bg = spec.bg0 },
BlinkCmpDocBorder = { fg = spec.sel0, bg = spec.bg0 },

BlinkCmpLabel = { fg = spec.fg1, },
BlinkCmpLabelDeprecated = { fg = syn.dep, style = "strikethrough" },
BlinkCmpLabelMatch = { fg = syn.func, },

BlinkCmpKindDefault = { fg = spec.fg2, },
BlinkCmpLabelDetail = { link = "Comment" },

BlinkCmpKindKeyword = { link = "Identifier" },

BlinkCmpKindVariable = { link = has_ts and "@variable" or "Identifier" },
BlinkCmpKindConstant = { link = has_ts and "@constant" or "Constant" },
BlinkCmpKindReference = { link = "Keyword" },
BlinkCmpKindValue = { link = "Keyword" },

BlinkCmpKindFunction = { link = "Function" },
BlinkCmpKindMethod = { link = "Function" },
BlinkCmpKindConstructor = { link = "Function" },

BlinkCmpKindInterface = { link = "Constant" },
BlinkCmpKindEvent = { link = "Constant" },
BlinkCmpKindEnum = { link = "Constant" },
BlinkCmpKindUnit = { link = "Constant" },

BlinkCmpKindClass = { link = "Type" },
BlinkCmpKindStruct = { link = "Type" },

BlinkCmpKindModule = { link = has_ts and "@namespace" or "Identifier" },

BlinkCmpKindProperty = { link = has_ts and "@property" or "Identifier" },
BlinkCmpKindField = { link = has_ts and "@field" or "Identifier" },
BlinkCmpKindTypeParameter = { link = has_ts and "@field" or "Identifier" },
BlinkCmpKindEnumMember = { link = has_ts and "@field" or "Identifier" },
BlinkCmpKindOperator = { link = "Operator" },
BlinkCmpKindSnippet = { fg = spec.fg2 },
}
end

return M

0 comments on commit e75fd91

Please sign in to comment.