1
0
Fork 0

nvim: Migrate configuration to lua and built-in plugin manager

This commit is contained in:
Olli 2026-04-19 12:53:37 +02:00
commit 6440203958
26 changed files with 453 additions and 616 deletions

View file

@ -1,33 +1,22 @@
return {
"hrsh7th/nvim-cmp",
lazy = true,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
config = function()
local cmp = require("cmp")
vim.pack.add({
gh("hrsh7th/nvim-cmp"),
gh("hrsh7th/cmp-nvim-lsp"),
gh("hrsh7th/cmp-buffer"),
gh("hrsh7th/cmp-path"),
})
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "path" },
}),
})
vim.cmd([[
set completeopt=menuone,noinsert,noselect
highlight! default link CmpItemKind CmpItemMenuDefault
]])
end,
}
local cmp = require("cmp")
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "path" },
}),
})