NIVM/lua/plugins/specs/Completion.lua
Robert Morrison fb537df11b chore(init): Initial working version
Create and push an initial working version of this repo before I change
things on this machine

Signed-off-by: Robert Morrison <robert@closedless.xyz>
2023-09-10 22:22:30 +01:00

46 lines
1.2 KiB
Lua

-- Completion config.
return {
{
'L3MON4D3/LuaSnip', -- snippet engine
build = function()
if vim.fn.has('win32') == 0 then
return "echo -e 'NOTE: jsregexp is optional, failure here is ok' ; make install_jsregexp"
end
return nil
end,
config = function()
local lua_snippets = vim.fn.stdpath('config') .. '/luasnip'
local vscode_snippets = vim.fn.stdpath('config') .. '/snippets'
require('luasnip.loaders.from_vscode').lazy_load() -- load friendly-snippets
require('luasnip.loaders.from_vscode').lazy_load { paths = { vscode_snippets } }
require('luasnip.loaders.from_lua').lazy_load { paths = { lua_snippets } }
end,
dependencies = {
'rafamadriz/friendly-snippets',
},
},
{
'hrsh7th/nvim-cmp',
opts = function()
return require('plugins.configs.completion.cmp')
end,
config = function(_, opts)
local cmp = require('cmp')
cmp.setup(opts.cmp)
opts.cmd()
end,
event = { 'InsertEnter', 'VeryLazy', 'CmdlineEnter' },
dependencies = {
'LuaSnip',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-emoji',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'onsails/lspkind.nvim',
'saadparwaiz1/cmp_luasnip',
},
},
}