Skip to content

Commit

Permalink
neovim: complete from all visible buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
adomixaszvers committed Jan 21, 2025
1 parent 4ad8ddd commit 211b9c6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion profiles/cli/neovim/luapath/lua/myConfig/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,19 @@ cmp.setup({
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
{
name = 'buffer',
option = {
-- completes from visible buffers
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
},
},
})
})

Expand Down

0 comments on commit 211b9c6

Please sign in to comment.