fix js completion

This commit is contained in:
Alex Yatskov 2021-10-14 19:26:22 -07:00
parent 789ed2e213
commit 35d9bdaaa7
4 changed files with 16 additions and 0 deletions

6
.gitmodules vendored
View File

@ -85,3 +85,9 @@
[submodule "pack/plugins/opt/nvim-cmp"] [submodule "pack/plugins/opt/nvim-cmp"]
path = pack/plugins/opt/nvim-cmp path = pack/plugins/opt/nvim-cmp
url = https://github.com/hrsh7th/nvim-cmp.git url = https://github.com/hrsh7th/nvim-cmp.git
[submodule "pack/plugins/opt/cmp-vsnip"]
path = pack/plugins/opt/cmp-vsnip
url = https://github.com/hrsh7th/cmp-vsnip
[submodule "pack/plugins/opt/vim-vsnip"]
path = pack/plugins/opt/vim-vsnip
url = https://github.com/hrsh7th/vim-vsnip

@ -0,0 +1 @@
Subproject commit 1588c35bf8f637e8f5287477f31895781858f970

@ -0,0 +1 @@
Subproject commit 9ac8044206d32bea4dba34e77b6a3b7b87f65df6

View File

@ -1,8 +1,10 @@
" cmp-nvim-lsp, nvim-cmp, nvim-lspconfig " cmp-nvim-lsp, nvim-cmp, nvim-lspconfig
if has('nvim') if has('nvim')
packadd cmp-nvim-lsp packadd cmp-nvim-lsp
packadd cmp-vsnip
packadd nvim-cmp packadd nvim-cmp
packadd nvim-lspconfig packadd nvim-lspconfig
packadd vim-vsnip
lua << EOF lua << EOF
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
@ -63,6 +65,12 @@ lua << EOF
}, },
sources = { sources = {
{name = 'nvim_lsp'}, {name = 'nvim_lsp'},
{name = 'vsnip'},
},
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
}, },
} }