fix lualine colors, add mapping for lsp snippets, add neodev

This commit is contained in:
2024-06-01 22:49:07 +03:00
parent cde06b268f
commit 172d94f7bf
7 changed files with 114 additions and 56 deletions

View File

@@ -15,6 +15,7 @@ return {
config = function()
local cmp = require('cmp')
local luasnip = require("luasnip")
require("fidget").setup({})
require('mason').setup({})
@@ -37,7 +38,39 @@ return {
},
mapping = cmp.mapping.preset.insert({
-- `Enter` key to confirm completion
['<CR>'] = cmp.mapping.confirm({ select = false }),
['<CR>'] = cmp.mapping(function(fallback)
if cmp.visible() then
if luasnip.expandable() then
luasnip.expand()
else
cmp.confirm({
select = true,
})
end
else
fallback()
end
end),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
-- Ctrl+Space to trigger completion menu
['<C-Space>'] = cmp.mapping.complete(),
@@ -51,6 +84,7 @@ return {
require('luasnip').lsp_expand(args.body)
end,
},
})
end
}