mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-28 19:34:15 +00:00
38 lines
735 B
Lua
38 lines
735 B
Lua
|
local cmp = require('cmp')
|
||
|
|
||
|
cmp.setup({
|
||
|
snippet = {
|
||
|
expand = function(args)
|
||
|
require('luasnip').lsp_expand(args.body)
|
||
|
end,
|
||
|
},
|
||
|
window = {
|
||
|
completion = cmp.config.window.bordered(),
|
||
|
documentation = cmp.config.window.bordered(),
|
||
|
},
|
||
|
mapping = cmp.mapping.preset.insert({
|
||
|
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||
|
['<Tab>'] = cmp.mapping.confirm({ select = true }),
|
||
|
}),
|
||
|
sources = cmp.config.sources({
|
||
|
{ name = 'nvim_lsp' },
|
||
|
{ name = 'luasnip' },
|
||
|
}, {
|
||
|
{ name = 'buffer' },
|
||
|
})
|
||
|
})
|
||
|
|
||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||
|
mapping = cmp.mapping.preset.cmdline(),
|
||
|
sources = {
|
||
|
{ name = 'buffer' }
|
||
|
}
|
||
|
})
|
||
|
|
||
|
cmp.setup.cmdline(':', {
|
||
|
mapping = cmp.mapping.preset.cmdline(),
|
||
|
sources = {
|
||
|
{ name = 'path' }
|
||
|
}
|
||
|
})
|