mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-12 04:52:53 +01:00
37 lines
926 B
Lua
37 lines
926 B
Lua
local cmp = require "cmp"
|
|
|
|
cmp.setup {
|
|
snippet = {
|
|
expand = function(args)
|
|
require("luasnip").lsp_expand(args.body)
|
|
end,
|
|
},
|
|
|
|
mapping = {
|
|
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
|
|
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
|
|
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
|
["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item()),
|
|
["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item()),
|
|
["<CR>"] = cmp.mapping.confirm { select = true },
|
|
},
|
|
|
|
sources = cmp.config.sources {
|
|
{ name = "nvim_lsp" },
|
|
{ name = "luasnips" },
|
|
},
|
|
}
|
|
|
|
cmp.setup.cmdline("/", {
|
|
sources = {
|
|
{ name = "buffer" },
|
|
},
|
|
})
|
|
|
|
cmp.setup.cmdline(":", {
|
|
sources = cmp.config.sources({
|
|
{ name = "path" },
|
|
}, {
|
|
{ name = "cmdline" },
|
|
}),
|
|
})
|