This commit is contained in:
jimrothstein 2023-10-06 16:57:11 -07:00
parent 7c8571ae9f
commit 343f9cd394
1 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,5 @@
--
--[[
TODO:
=====================================================================
@ -112,7 +112,7 @@ require('lazy').setup({
},
{
-- Autocompletion
-- Autocompletion; exist several `extensions` to nvim-cmp
'hrsh7th/nvim-cmp',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
@ -631,10 +631,6 @@ mason_lspconfig.setup_handlers {
end,
}
-- [[ Configure nvim-cmp ]]
-- See `:help cmp`
local cmp = require 'cmp'
--
-- LUASNIP
local luasnip = require 'luasnip'
@ -668,6 +664,11 @@ ls.add_snippets('all', { -- `all` all filetypes, `lua` only lua ft
require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {}
-- nvim-cmp configuration
-- [[ Configure hrsh7th nvim-cmp ]]
-- See `:help cmp`
local cmp = require 'cmp'
cmp.setup {
snippet = {
expand = function(args)
@ -684,6 +685,7 @@ cmp.setup {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
-- TAB selects NEXT item (CR to complete)
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -703,9 +705,11 @@ cmp.setup {
end
end, { 'i', 's' }),
},
sources = {
sources = { -- need nvim-cmp extensions?
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' } ,
{ name = 'buffer', keyword_length = 5 },
},
}