feat: pick theme with telescope

This commit is contained in:
Stevan Freeborn
2025-01-18 00:15:54 -06:00
parent 38905222ca
commit 075e78c9ce
11 changed files with 97 additions and 45 deletions
+31 -11
View File
@@ -12,13 +12,15 @@ return {
{
"hrsh7th/nvim-cmp",
config = function()
local luasnip = require("luasnip")
local cmp = require("cmp")
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
luasnip.lsp_expand(args.body)
end,
},
window = {
@@ -26,21 +28,39 @@ return {
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-u>"] = cmp.mapping.scroll_docs(-4),
["<C-d>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources(
{
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
},
{
}, {
{ name = "buffer" },
}),
})
end
}
end,
},
}