From 1aead50db35dea44c10ac84455635c0b790582e0 Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Mon, 10 Apr 2023 00:55:36 +0100 Subject: [PATCH] Add buffer as a source for completion --- .config/nvim/after/plugin/lsp.lua | 6 +++++- .config/nvim/lua/sheldonmlee/packer.lua | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index e6d26de..965be44 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -1,4 +1,8 @@ -local lsp = require('lsp-zero').preset({}) +local lsp = require('lsp-zero').preset({ + manage_nvim_cmp = { + set_sources = 'recommended', + } +}) local cmp = require('cmp'); -- Set the lsp autocomplete to put text from selection into the buffer. diff --git a/.config/nvim/lua/sheldonmlee/packer.lua b/.config/nvim/lua/sheldonmlee/packer.lua index a74bb01..35843b0 100644 --- a/.config/nvim/lua/sheldonmlee/packer.lua +++ b/.config/nvim/lua/sheldonmlee/packer.lua @@ -39,6 +39,7 @@ return require('packer').startup(function(use) -- Autocompletion {'hrsh7th/nvim-cmp'}, -- Required {'hrsh7th/cmp-nvim-lsp'}, -- Required + {'hrsh7th/cmp-buffer'}, {'L3MON4D3/LuaSnip'}, -- Required } }