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

Integrate with nvim-cmp #93

Open
qRoC opened this issue Jan 4, 2022 · 0 comments
Open

Integrate with nvim-cmp #93

qRoC opened this issue Jan 4, 2022 · 0 comments

Comments

@qRoC
Copy link

qRoC commented Jan 4, 2022

Something like that:

local source = {}

source.complete = function(self, params, callback)
  vim.fn["tmuxcomplete#async#gather_candidates"](function (raw_items)
    local items = {}
    for _, word in ipairs(raw_items) do
      table.insert(items, {
        label = word,
        dup = 0,
      })
    end

    callback({ items = items })
  end)
end

source.new = function()
  return setmetatable({}, { __index = source })
end
require('cmp').register_source('tmux', source.new())
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

1 participant