Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document if completion from all visible buffers is default or how to set it up #54

Open
matu3ba opened this issue Jul 11, 2022 · 5 comments

Comments

@matu3ba
Copy link

matu3ba commented Jul 11, 2022

With the defaults and typing Oth I dont get a completion to the word Other in the other open bufffer.

@gegoune
Copy link

gegoune commented Jul 11, 2022

But it is documented. https://github.com/hrsh7th/cmp-buffer#get_bufnrs-type-fun-number

@matu3ba
Copy link
Author

matu3ba commented Jul 11, 2022

Ah. Why not adding the defaults into https://github.com/hrsh7th/cmp-buffer#configuration like what is the convention for plugins?

@matu3ba
Copy link
Author

matu3ba commented Jul 11, 2022

I can make a PR, if that would be okay for you.

@matu3ba
Copy link
Author

matu3ba commented Jul 11, 2022

Mhm, for some reason that did not work and I cant find the symbols from the other file. My session file should not interfere with that and file size is not huge either. Changing the file with saving did not fix it either.

@AlaaSaadAbdo
Copy link

AlaaSaadAbdo commented Aug 8, 2022

How do I go about using:

get_bufnrs = function()
  return vim.api.nvim_list_bufs()
end

To complete from all open buffers?

for people that come here looking:

cmp.setup.cmdline("/", {
  mapping = cmp.mapping.preset.cmdline(),
  sources = {
    {
      name = "buffer",
      option = {
        get_bufnrs = function()
          return vim.api.nvim_list_bufs()
        end,
      },
    },
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants