Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
4.03k stars 143 forks source link

A possible resolution of tab completion #417

Closed little-populus closed 1 month ago

little-populus commented 1 month ago

when use luasnip plugin, default completion key tab will be replaced by nvim-cmp as jump-next or tab instead, here my config will rank it as jump-next first, codeium#accept next and tab finally.

 {
      "nvim-cmp",
    -- stylua: ignore
    keys = {
      {
        "<tab>",
          function()
          local luasnip = require("luasnip")
          local fn = vim.fn
          if luasnip.jumpable(1) then
            return "<Plug>luasnip-jump-next"
          elseif fn["codeium#Accept"]() ~= "" then
            return fn["codeium#Accept"]()
          else
            return "<tab>"
          end
        end,
        expr = true, silent = true, mode = "i",
      },
      { "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
      { "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
    },
    },

image

LeonardoMor commented 1 month ago

This is good, but is there an issue with the plugin itself? Maybe Discussions would be a better place to post this

little-populus commented 1 month ago

yeah, I note, this issue should be closed.

little-populus commented 1 month ago

no problem