From 9a81a29971b2d4b9811d9e4627a9bb01ef0f9883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 8 Oct 2021 20:47:52 +0200 Subject: [PATCH] Add more sources for nvim-cmp --- symlinks/config/nvim/lua/init/plugins.lua | 3 +++ symlinks/config/nvim/lua/lsp/completion.lua | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/symlinks/config/nvim/lua/init/plugins.lua b/symlinks/config/nvim/lua/init/plugins.lua index 7c476e0..a68f209 100644 --- a/symlinks/config/nvim/lua/init/plugins.lua +++ b/symlinks/config/nvim/lua/init/plugins.lua @@ -80,6 +80,9 @@ return require('packer').startup { use 'alexaandru/nvim-lspupdate' -- Easy install and update for many LSP servers use 'hrsh7th/cmp-nvim-lsp' -- LSP source for cmp use 'hrsh7th/cmp-buffer' -- Buffer source for nvim-cmp + use 'hrsh7th/cmp-path' -- Path source for nvim-cmp + use 'hrsh7th/cmp-nvim-lua' -- Nvim-Lua source for nvim-cmp + use 'quangnguyen30192/cmp-nvim-ultisnips' -- Ultisnips source for nvim-cmp use 'hrsh7th/nvim-cmp' -- completion integration use 'nvim-lua/lsp_extensions.nvim' -- LSP extensions (like closing labels for Dart) diff --git a/symlinks/config/nvim/lua/lsp/completion.lua b/symlinks/config/nvim/lua/lsp/completion.lua index 95ecf69..6f63057 100644 --- a/symlinks/config/nvim/lua/lsp/completion.lua +++ b/symlinks/config/nvim/lua/lsp/completion.lua @@ -9,8 +9,8 @@ local cmp = require'cmp' cmp.setup { snippet = { expand = function(args) - vim.fn["UltiSnips#Anon"](args.body) - end, + vim.fn["UltiSnips#Anon"](args.body) + end, }, mapping = { [''] = cmp.mapping.scroll_docs(-4), @@ -21,6 +21,8 @@ cmp.setup { }, sources = { { name = 'nvim_lsp' }, + { name = 'nvim_lua' }, + { name = 'path' }, { name = 'ultisnips' }, { name = 'buffer' }, }