Exafunction / codeium.vim

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

feat: accept next word and next line completions. #380

Closed LeonardoMor closed 1 week ago

LeonardoMor commented 2 weeks ago

The process of inserting suggestions is always roughly the same, so abstracted that into the s:CompletionInserter function.

With that, I refactored codeium#Accept (maintaining the same functionality) and introduced codeium#AcceptNextWord and codeium#AcceptNextLine. Fixes #27

CLAassistant commented 2 weeks ago

CLA assistant check
All committers have signed the CLA.

fortenforge commented 2 weeks ago

Amazing! Can you add default keybindings for these as well?

LeonardoMor commented 2 weeks ago

Sure :)

Kythonlk commented 1 week ago

I got error for this image

in insert mode if i press next arrow key it will enter "-1" then give error msg

This is my lazy vim plugin config to codium.

return { { "Exafunction/codeium.vim", event = "BufEnter", config = function() -- Change '' here to any keycode you like.

  vim.keymap.set("i", "<C-z>", function()
    return vim.fn["codeium#Accept"]()
  end, { expr = true, silent = true })
  vim.keymap.set("i", "<c-;>", function()
    return vim.fn["codeium#CycleCompletions"](1)
  end, { expr = true, silent = true })
  vim.keymap.set("i", "<c-,>", function()
    return vim.fn["codeium#CycleCompletio-1ns"](-1)
  end, { expr = true, silent = true })
  vim.keymap.set("i", "<c-x>", function()
    return vim.fn["codeium#Clear"]()
  end, { expr = true, silent = true })
end--11,

}, }

os: Manjaro 6.6 (Arch) neovim : v11