aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-01-21 20:47:06 +0100
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-01-21 20:47:06 +0100
commita9c14629bdb3edd1d9803b9a6e311f8ba256908e (patch)
treec14e826876260109a7b3e2cbc01b6c03509b4f3f /lua
parent3f969d2a0c23dbdcb1439e875eb68de3a479f6a6 (diff)
downloadnvim-conf-a9c14629bdb3edd1d9803b9a6e311f8ba256908e.tar.gz
nvim-conf-a9c14629bdb3edd1d9803b9a6e311f8ba256908e.zip
add completition for open buffers
Diffstat (limited to 'lua')
-rw-r--r--lua/alpha/completition.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/lua/alpha/completition.lua b/lua/alpha/completition.lua
index 987763d..730004e 100644
--- a/lua/alpha/completition.lua
+++ b/lua/alpha/completition.lua
@@ -39,7 +39,19 @@ cmp.setup {
{ name = "nvim_lsp" },
{ name = "path" },
{ name = "luasnip" },
- { name = "buffer", keyword_length = 5 },
+ {
+ name = "buffer",
+ keyword_length = 5,
+ option = {
+ get_bufnrs = function()
+ local bufs = {}
+ for _, win in ipairs(vim.api.nvim_list_wins()) do
+ bufs[vim.api.nvim_win_get_buf(win)] = true
+ end
+ return vim.tbl_keys(bufs)
+ end
+ }
+ },
},
snippet = {