Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blink.cmp): add support for blink.cmp plugin #370

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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