['<Tab>'] = cmp.mapping.select_next_item(cmp_select),
})
+local cmp_snippet = {
+ expand = function(args)
+ require('luasnip').lsp_expand(args.body)
+ end
+}
+
local cmp_sources = cmp.config.sources({
- { name = 'nvim_lsp' }
+ { name = 'nvim_lsp' },
+ { name = 'luasnip' }
})
cmp.setup {
mapping = cmp_mappings,
- --TODO snippet = ...,
+ snippet = cmp_snippet,
sources = cmp_sources
}
use('hrsh7th/nvim-cmp')
-- additional capabilities
use('hrsh7th/cmp-nvim-lsp')
+ -- snippet engine
+ use({"L3MON4D3/LuaSnip", tag = "v2.*"})
+ use{'saadparwaiz1/cmp_luasnip'}
-- syntax highlighting
use {
run = function()
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
ts_update()
- end,
+ end,
}
-- diagnostics
-- wiki
use {
- 'serenevoid/kiwi.nvim',
+ 'serenevoid/kiwi.nvim',
requires = { {'nvim-lua/plenary.nvim'} }
}
end)
time([[try_loadstring definition]], false)
time([[Defining packer_plugins]], true)
_G.packer_plugins = {
+ LuaSnip = {
+ loaded = true,
+ path = "/home/lukas/.local/share/nvim/site/pack/packer/start/LuaSnip",
+ url = "https://github.com/L3MON4D3/LuaSnip"
+ },
["cmp-nvim-lsp"] = {
loaded = true,
path = "/home/lukas/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
+ cmp_luasnip = {
+ loaded = true,
+ path = "/home/lukas/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
+ url = "https://github.com/saadparwaiz1/cmp_luasnip"
+ },
harpoon = {
loaded = true,
path = "/home/lukas/.local/share/nvim/site/pack/packer/start/harpoon",