Skip to content

Commit

Permalink
feat(blink.cmp): add support for blink.cmp plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
tim3nd committed Dec 12, 2024
1 parent 0e4636f commit 2010b7a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ This command will attach an autocmd to the current buffer that executes on `Buff
- [vim-airline](https://github.com/vim-airline/vim-airline)
- [vim-gitgutter](https://github.com/airblade/vim-gitgutter)
- [which-key.nvim](https://github.com/folke/which-key.nvim)
- [blink.cmp](https://github.com/Saghen/blink.cmp)

## Status lines

Expand Down
1 change: 1 addition & 0 deletions lua/github-theme/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ M.module_names = {
'treesitter',
'treesitter_context',
'whichkey',
'blink_cmp',
}

---@param name GhTheme.Theme
Expand Down
57 changes: 57 additions & 0 deletions lua/github-theme/group/modules/blink_cmp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
-- https://github.com/Saghen/blink.cmp

local M = {}

---@param spec GhTheme.Spec
---@param config GhTheme.Config.Options
---@param _opts GhTheme.Config.Module
function M.get(spec, config, _opts)
local has_ts = config.modules.treesitter == true
or type(config.modules.treesitter) == 'table' and config.modules.treesitter.enable
local syn = spec.syntax

-- stylua: ignore
---@type table<string, GhTheme.HighlightGroup>
return {
BlinkCmpMenu = { fg = spec.fg1, bg = spec.bg1 },
BlinkCmpMenuBorder = { link = 'FloatBorder' },

BlinkCmpDoc = { fg = spec.fg1, bg = spec.bg1 },
BlinkCmpDocBorder = { link = 'FloatBorder' },
BlinkCmpDocSeparator = { link = 'FloatBorder' },

BlinkCmpSource = { link = 'Comment' },

BlinkCmpLabel = { fg = spec.fg1, },
BlinkCmpLabelDeprecated = { fg = syn.dep, style = 'strikethrough' },
BlinkCmpLabelMatch = { fg = syn.func, },
BlinkCmpLabelDetail = { link = 'Comment' },
BlinkCmpLabelDescription = { link = 'Comment' },

BlinkCmpKind = { fg = spec.fg2, },
BlinkCmpKindKeyword = { link = 'Keyword' },
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 = has_ts and '@constructor' or 'Type' },
BlinkCmpKindInterface = { link = 'Constant' },
BlinkCmpKindEvent = { link = 'Constant' },
BlinkCmpKindEnum = { link = 'Constant' },
BlinkCmpKindUnit = { link = 'Constant' },
BlinkCmpKindClass = { link = 'Type' },
BlinkCmpKindStruct = { link = 'Type' },
BlinkCmpKindModule = { link = has_ts and '@module' or 'Identifier' },
BlinkCmpKindProperty = { link = has_ts and '@property' or 'Identifier' },
BlinkCmpKindField = { link = has_ts and '@variable.member' or 'Identifier' },
BlinkCmpKindTypeParameter = { link = has_ts and '@variable.member' or 'Identifier' },
BlinkCmpKindEnumMember = { link = has_ts and '@variable.member' or 'Identifier' },
BlinkCmpKindOperator = { link = 'Operator' },
BlinkCmpKindSnippet = { fg = spec.fg2 },
}
end

return M

0 comments on commit 2010b7a

Please sign in to comment.