nvim: cmp: add nvim completion for lua files

This commit is contained in:
tastytea 2022-08-12 19:54:40 +02:00
parent 59b75ab95a
commit 082f7d7be6
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM

View File

@ -14,6 +14,7 @@ packer.use {
'https://github.com/saadparwaiz1/cmp_luasnip',
requires = 'https://github.com/L3MON4D3/LuaSnip'
},
'https://github.com/hrsh7th/cmp-nvim-lua',
},
config = function()
local cmp = require'cmp'
@ -68,13 +69,15 @@ packer.use {
})
-- -- Set configuration for specific filetype.
-- cmp.setup.filetype('gitcommit', {
-- sources = cmp.config.sources({
-- { name = 'cmp_git' },
-- }, {
-- { name = 'buffer' },
-- })
-- })
cmp.setup.filetype('lua', {
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'nvim_lua' },
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/`
cmp.setup.cmdline('/', {