style(nvim-cmp.lua): reformat code for better readability and consistency

feat(nvim-cmp.lua): add custom source "otter" for otter completion in autocompletion sources
This commit is contained in:
David Ibia
2024-03-10 12:22:25 +01:00
parent 3e9289046f
commit b5d1df5dc5

View File

@@ -5,7 +5,6 @@ local lspkind = require("lspkind")
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect",
@@ -17,10 +16,11 @@ cmp.setup({
},
mapping = cmp.mapping.preset.insert({
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<CR>"] = cmp.mapping.confirm({ select = false }) -- accept current selection
["<CR>"] = cmp.mapping.confirm({ select = false }), -- accept current selection
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "otter" }, -- custom source for otter completion
{ name = "nvim_lsp" },
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer