48 lines
1.1 KiB
Lua
48 lines
1.1 KiB
Lua
-- https://github.com/hrsh7th/nvim-cmp
|
|
-- Basically a completion plugin for neovim
|
|
return {
|
|
{
|
|
"hrsh7th/nvim-cmp",
|
|
dependencies = {
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
{
|
|
"L3MON4D3/LuaSnip",
|
|
build = "make install_jsregexp"
|
|
},
|
|
"saadparwaiz1/cmp_luasnip", -- luasnip autocompletion
|
|
"hrsh7th/cmp-path" -- Path finder
|
|
},
|
|
config = function()
|
|
local cmp = require("cmp")
|
|
local luasnip = require("luasnip")
|
|
|
|
cmp.setup({
|
|
snippet = {
|
|
expand = function(args)
|
|
luasnip.lsp_expand(args.body)
|
|
end
|
|
},
|
|
mapping = cmp.mapping.preset.insert({
|
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
|
['<Tab>'] = cmp.mapping.select_next_item(),
|
|
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
|
|
|
}),
|
|
sources = cmp.config.sources({
|
|
{ name = 'nvim_lsp' },
|
|
{ name = 'luasnip' },
|
|
{ name= 'path' }
|
|
}),
|
|
formatting = {
|
|
format = require("nvim-highlight-colors").format
|
|
}
|
|
})
|
|
end
|
|
},
|
|
|
|
{
|
|
"windwp/nvim-autopairs",
|
|
event = "InsertEnter",
|
|
config = true
|
|
}
|
|
}
|