feat(nvim): add luasnip

This commit is contained in:
Oliver Davies 2021-10-19 23:05:11 +01:00
parent 685f68f70a
commit 6c75b2ce66
2 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,12 @@
local cmp = require "cmp"
cmp.setup {
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
mapping = {
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
@ -23,6 +29,7 @@ cmp.setup {
{ name = "nvim_lua" },
-- Plugins
{ name = "luasnip" },
{ name = "cmp_tabnine" },
},
}

View file

@ -30,10 +30,12 @@ Plug 'JoosepAlviste/nvim-ts-context-commentstring'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
" Completion
Plug 'L3MON4D3/LuaSnip'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/nvim-cmp'
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'tzachar/cmp-tabnine', { 'do': './install.sh' }
" LSP