Skip to content

Commit

Permalink
fix: latest nvim-cmp can't be used with codeium
Browse files Browse the repository at this point in the history
  • Loading branch information
loctvl842 committed Aug 19, 2023
1 parent 9a36e2d commit efbc504
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions lua/tvl/core/resources/coding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ return {
"hrsh7th/nvim-cmp",
version = false,
event = { "InsertEnter", "CmdlineEnter" },
commit = "b8c2a62b3bd3827aa059b43be3dd4b5c45037d65",
dependencies = {
"mfussenegger/nvim-jdtls",
"hrsh7th/cmp-nvim-lsp",
Expand Down Expand Up @@ -130,19 +131,24 @@ return {
end),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "codeium" },
{ name = "nvim_lsp", keyword_length = 2 },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "buffer", keyword_length = 3 },
{ name = "path" },
}),
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, item)
local icons = require("tvl.core.icons").kinds
item.kind = icons[item.kind]
local icons = require("tvl.core.icons")
item.kind = icons.kinds[item.kind]
if entry.source.name == "codeium" then
item.kind = icons.misc.codeium
item.kind_hl_group = "CmpItemKindVariable"
end
item.menu = ({
codeium = "Codeium",
nvim_lsp = "Lsp",
nvim_lua = "Lua",
luasnip = "Snippet",
buffer = "Buffer",
path = "Path",
Expand All @@ -169,15 +175,12 @@ return {
"echasnovski/mini.comment",
event = "VeryLazy",
opts = {
hooks = {
pre = function()
require("ts_context_commentstring.internal").update_commentstring({})
options = {
custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
end,
},
},
config = function(_, opts)
require("mini.comment").setup(opts)
end,
},

{
Expand All @@ -199,12 +202,10 @@ return {
},

{
"jackMort/ChatGPT.nvim",
lazy = require("tvl.util").apikey == nil,
"jcdickinson/codeium.nvim",
event = { "InsertEnter", "CmdlineEnter" },
config = function()
require("chatgpt").setup({
api_key_cmd = require("tvl.util").apikey,
})
require("codeium").setup({})
end,
},
}

0 comments on commit efbc504

Please sign in to comment.