Compare commits

..

No commits in common. "2df38d379d508cad3e3aa5c7f006f94fef96b914" and "d1f910db692e141c2da3b4fb16ebb5f2273ff9d0" have entirely different histories.

3 changed files with 51 additions and 62 deletions

View File

@ -48,64 +48,59 @@ require("nvim-treesitter.configs").setup({
}, },
}) })
-- load cmp on InsertEnter local cmp = require("cmp")
vim.api.nvim_create_autocmd("InsertEnter", { local luasnip = require("luasnip")
callback = function() require("copilot_cmp").setup()
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
maxwidth = 50, -- prevent the popup from showing more than provided characters maxwidth = 50, -- prevent the popup from showing more than provided characters
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead
symbol_map = { symbol_map = {
Copilot = "", Copilot = "",
},
}),
}, },
snippet = { }),
-- REQUIRED - you must specify a snippet engine },
expand = function(args) snippet = {
require("luasnip").lsp_expand(args.body) -- REQUIRED - you must specify a snippet engine
end, expand = function(args)
}, require("luasnip").lsp_expand(args.body)
mapping = cmp.mapping.preset.insert({ end,
["<C-b>"] = cmp.mapping.scroll_docs(-4), },
["<C-f>"] = cmp.mapping.scroll_docs(4), mapping = cmp.mapping.preset.insert({
["<C-Space>"] = cmp.mapping.complete(), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-e>"] = cmp.mapping.abort(), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<CR>"] = cmp.mapping.confirm({ select = true }), ["<C-Space>"] = cmp.mapping.complete(),
["<Tab>"] = cmp.mapping(function(fallback) ["<C-e>"] = cmp.mapping.abort(),
if cmp.visible() then ["<CR>"] = cmp.mapping.confirm({ select = true }),
cmp.select_next_item() ["<Tab>"] = cmp.mapping(function(fallback)
elseif luasnip.expand_or_jumpable() then if cmp.visible() then
luasnip.expand_or_jump() cmp.select_next_item()
else elseif luasnip.expand_or_jumpable() then
fallback() luasnip.expand_or_jump()
end else
end, { "i", "s" }), fallback()
["<S-Tab>"] = cmp.mapping(function(fallback) end
if cmp.visible() then end, { "i", "s" }),
cmp.select_prev_item() ["<S-Tab>"] = cmp.mapping(function(fallback)
elseif luasnip.jumpable(-1) then if cmp.visible() then
luasnip.jump(-1) cmp.select_prev_item()
else elseif luasnip.jumpable(-1) then
fallback() luasnip.jump(-1)
end else
end, { "i", "s" }), fallback()
}), end
sources = { end, { "i", "s" }),
{ name = "buffer", priority = 1 }, }),
{ name = "copilot", priority = 8 }, sources = {
{ name = "luasnip", priority = 7 }, { name = "buffer", priority = 1 },
{ name = "nvim_lsp", priority = 9 }, { name = "copilot", priority = 8 },
{ name = "orgmode", priority = 9 }, { name = "luasnip", priority = 7 },
}, { name = "nvim_lsp", priority = 9 },
}) { name = "orgmode", priority = 9 },
end, },
}) })
---merge tables ---merge tables

View File

@ -5,5 +5,4 @@ lib.composeManyExtensions [
(import ./packages.nix { inherit inputs lib; }) (import ./packages.nix { inherit inputs lib; })
(import ./vimPlugins.nix { inherit inputs lib; }) (import ./vimPlugins.nix { inherit inputs lib; })
(import ./wayland.nix { inherit inputs lib; }) (import ./wayland.nix { inherit inputs lib; })
(import ./lib.nix { inherit inputs lib; })
] ]

View File

@ -1,5 +0,0 @@
{ lib, inputs }:
final: prev: {
inherit lib;
}