mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
37 lines
735 B
Lua
37 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' }
|
|
}
|
|
})
|