feat(nvim): add lazy loading for cmp

This commit is contained in:
Moritz Böhme 2023-03-07 14:26:37 +01:00
parent 0556bfe81e
commit 2df38d379d
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -48,11 +48,14 @@ require("nvim-treesitter.configs").setup({
}, },
}) })
local cmp = require("cmp") -- load cmp on InsertEnter
local luasnip = require("luasnip") vim.api.nvim_create_autocmd("InsertEnter", {
require("copilot_cmp").setup() callback = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
require("copilot_cmp").setup()
cmp.setup({ cmp.setup({
formatting = { formatting = {
format = require("lspkind").cmp_format({ format = require("lspkind").cmp_format({
mode = "symbol", -- show only symbol annotations mode = "symbol", -- show only symbol annotations
@ -101,6 +104,8 @@ cmp.setup({
{ name = "nvim_lsp", priority = 9 }, { name = "nvim_lsp", priority = 9 },
{ name = "orgmode", priority = 9 }, { name = "orgmode", priority = 9 },
}, },
})
end,
}) })
---merge tables ---merge tables