codeium.vim icon indicating copy to clipboard operation
codeium.vim copied to clipboard

Option + Right Bracket keyboard shortcut does not show alternate suggestions.

Open arturpedrotti opened this issue 1 year ago • 8 comments

  • Operating System (OS) Version: macOS 13.5 (arm64)

  • Neovim Version: NVIM v0.9.1

    • Build type: Release
    • LuaJIT 2.1.0-beta3
  • Programming Language Versions:

  • Python: 3.11.5

Issue Details:

Utilizing the Option + Right Bracket keyboard shortcut does not yield the expected outcome of viewing alternative suggestions. Could you please assist in resolving this issue?

arturpedrotti avatar Sep 07 '23 03:09 arturpedrotti

You might need to check the setting "use option as meta key"

fortenforge avatar Sep 07 '23 21:09 fortenforge

https://www.shell-tips.com/mac/meta-key/#gsc.tab=0

fortenforge avatar Sep 07 '23 21:09 fortenforge

I have the same problem.

dcy avatar Sep 08 '23 01:09 dcy

image item2 still not work

dcy avatar Sep 08 '23 01:09 dcy

I am interested in rebinding the "Next Suggestion" functionality to a different key, such as Ctrl + Right Bracket.

I have looked through the documentation and source code but could not find the specific function responsible for this feature. Could you please provide the name of this function so that I can rebind it in my init.lua configuration file?

Thanks for the assistance.

arturpedrotti avatar Sep 08 '23 16:09 arturpedrotti

The Keybindings section of the readme very explicitly explains how to rebind the Next Suggestion command: https://github.com/Exafunction/codeium.vim#%EF%B8%8F-keybindings

fortenforge avatar Sep 08 '23 17:09 fortenforge

I too am failing to get any of the keybindings to work correctly.

Neovim 0.9.5 (Mac) Lazy.vim

A couple issues:

  1. I think this repo should explicitly state Windows only? It fails trying to load an .exe binary at launch. The other Codeium.nvim repo installs and runs fine. However it is missing the documentation on setting up alternative keybindings, but I'm assuming it's the same.
  2. I'm fairly certain <c- is not a valid keymap for CONTROL, should all be <C- ?
  3. Even still, with default config: <CR> accepts suggestion for me, not <TAB>. (I can live with that)
  4. Neither the default cycle bindings work for me, nor does the fixed up suggested starter custom config. Oddly the directional up/down arrows do but who wants to use them? 🤣 I actually have a 60% keyboard anyway.

This is the separate lazy.vim config file I have:

codeium.lua:

return {
  {
    "Exafunction/codeium.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
      "hrsh7th/nvim-cmp",
    },
    lazy = false,
    config = function()
      -- Change '<C-g>' here to any keycode you like.
      -- vim.keymap.set('i', '<C-g>', 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#CycleCompletions"](-1)
      end, { expr = true, silent = true })
      vim.keymap.set("i", "<C-x>", function()
        return vim.fn["codeium#Clear"]()
      end, { expr = true, silent = true })
    end,
  },
}

jasonshanks avatar Apr 16 '24 12:04 jasonshanks

Wasn't working for me. I was able to do this instead, though:

" codeium
imap <S-Tab> <Cmd>call codeium#CycleCompletions(1)<CR>
set statusline+=\{…\}%3{codeium#GetStatusString()}

This makes Shift + Tab the next suggestion. Single Tab remains accept as per defaults. No combination of Ctrl + key worked.

gxespino avatar Aug 31 '24 21:08 gxespino