0.0.1
This commit is contained in:
commit
36c66e33e6
17 changed files with 348 additions and 0 deletions
44
lua/plugins/cmp.lua
Normal file
44
lua/plugins/cmp.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
|
||||
preselect = cmp.PreselectMode.Item,
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue