aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-10-23 17:40:38 +0800
committerjdhao <jdhao@hotmail.com>2021-10-23 17:40:38 +0800
commit9a5318c0e18e65a3eaf5e4882e49043dab2ef127 (patch)
treeed304fcf1dd5fb0d0cb4ce7d809bf5a024b5001e /lua
parent9d40dce70ec31bc04a46718863c91cb8a9f24bcf (diff)
add plugin cmp-buffer
Diffstat (limited to 'lua')
-rw-r--r--lua/config/nvim-cmp.lua2
-rw-r--r--lua/plugins.lua1
2 files changed, 3 insertions, 0 deletions
diff --git a/lua/config/nvim-cmp.lua b/lua/config/nvim-cmp.lua
index a96dc6f..7038540 100644
--- a/lua/config/nvim-cmp.lua
+++ b/lua/config/nvim-cmp.lua
@@ -34,6 +34,7 @@ cmp.setup({
{ name = 'ultisnips' }, -- For ultisnips user.
{ name = 'nvim_lua' }, -- for nvim lua function
{ name = 'path' }, -- for path completion
+ { name = 'buffer', keyword_length = 4 }, -- for buffer word completion
{ name = 'emoji', insert = true, } -- emoji completion
},
completion = {
@@ -51,6 +52,7 @@ cmp.setup({
ultisnips = "[US]",
nvim_lua = "[Lua]",
path = "[Path]",
+ buffer = "[Buffer]",
emoji = "[Emoji]",
},
}),
diff --git a/lua/plugins.lua b/lua/plugins.lua
index 45e2227..c506353 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -39,6 +39,7 @@ require("packer").startup({
use {"hrsh7th/cmp-nvim-lua", after = "nvim-cmp"}
use {"hrsh7th/cmp-path", after = "nvim-cmp"}
+ use {"hrsh7th/cmp-buffer", after = "nvim-cmp"}
use {"quangnguyen30192/cmp-nvim-ultisnips", after = {'nvim-cmp', 'ultisnips'}}
if vim.g.is_mac then
use {"hrsh7th/cmp-emoji", after = 'nvim-cmp'}