feat: add plugins

Signed-off-by: d0zingcat <iamtangli42@gmail.com>
This commit is contained in:
2025-10-18 10:25:26 +08:00
parent 6cfd65a389
commit 36f59cda51
25 changed files with 2547 additions and 222 deletions

34
nvim/lua/plugins/cmp.lua Normal file
View File

@@ -0,0 +1,34 @@
-- cmp.lua - 自动补全配置
return {
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
event = "InsertEnter",
opts = function()
local cmp = require("cmp")
return {
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
}
end,
},
}