Coder Social home page Coder Social logo

exafunction / codeium.vim Goto Github PK

View Code? Open in Web Editor NEW
3.4K 30.0 114.0 186 KB

Free, ultrafast Copilot alternative for Vim and Neovim

Home Page: https://codeium.com

License: MIT License

Vim Script 98.08% PowerShell 1.92%
autocomplete copilot go golang javascript neovim python typescript vim codeium

codeium.vim's People

Contributors

anthonyutt avatar aunch avatar bleksak avatar comiluv avatar cprn avatar cy-r0 avatar fortenforge avatar ingomeyer441 avatar jakubbortlik avatar juliosueiras avatar khou22 avatar klew avatar luismeyer95 avatar njiang747 avatar nyngwang avatar pinaki82 avatar pqn avatar psalm842 avatar rotrixlol avatar saverio976 avatar shougo avatar sigmasd avatar sullivan-sean avatar theleop avatar toofar avatar varunmohan avatar vphantom avatar weirongxu avatar wilriker avatar zarubaru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeium.vim's Issues

Per-root Telemetry Opt Out/In Options

I currently have the logging/telemetry turned off because I don't want to leak code from my employer. However, I would be thrilled to provide telemetry while working on my public/OSS projects.

Maybe allow this to be set with either an environment variable, or some "root file" such as a .codeiumrc with contents such as:

telemetry = true

A very close second would be to have something like:

let g:codeium_telemetry = v:true

This would completely override the setting on the website (i.e. the value on the website is ignored if this configuration is present). This would allow a user who normally opts into telemetry to opt out, and a user who normally opts out of telemetry to opt in. Orgs could also commit this file into their repo to prevent developers from accidentally leaking private code.

bug: codeium#Accept completing only current line when multiline empty parenthesis

Config: .config/nvim
NVIM Versión: v0.9.0-dev-829+gaec4b476c

Virtual text suggestion between [], cursor |:

fn factorial_recursive (n: u64) -> u64 {
    match n {
        0 => 1,
        _ => n * factorial_recursive(n-1)
    };
    ma|[tch n {

    }]
}

call codeium#Accept

fn factorial_recursive (n: u64) -> u64 {
    match n {
        0 => 1,
        _ => n * factorial_recursive(n-1)
    };
    match n {|
}

rust code but same in typescript and ...

Process failed to start: no such file or directory.....

Failed to source /home/itznesbro/.local/share/nvim/lazy/codeium.vim/plugin/codeium.vim

...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:346: Vim(let):E903: Process
failed to start: no such file or directory: "/home/itznesbro/.codeium/bin/0a0cf69c54bd02
be577e1240463b85d782fa5475/language_server_linux_arm"

Starting gvim from terminal is blocking terminal usage

After yestarday's changes, something changed in codeium.vim during gvim startup.

I usually start gvim by calling:
gvim .

then it starts gvim and control on terminal goes back to bash, so I can use it.
After recent changes, gvim blocks the terminal and I can't use it until I close gvim.

It works as expected when I remove codeium.vim.

let g:codeium_enabled = v:false breaks <Tab> key

  • Description
    Setting global variable codeium_enabled to false breaks Tab key functionality
  • Steps to repro
  1. :Codeium Disable
  2. Press i to enter insert mode
  3. Press Tab key
  4. See bug
  • Bug
    Tab key does not move the cursor by a tab
  • Expected
    The cursor moves forward by a tab in insert mode even with :Codeium Disable
  • Environment
    Windows 11 22H2
    Neovim 0.8.3
    Windows Terminal

rebinding key as told in README does not work

let g:codeium_disable_bindings = 1 does disable and other bindings, but
imap <C-g> <Cmd>call codeium#Accept()<CR> does not bind ctrl-g to work.
vim version VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Nov 18 2022 12:52:50)

Installation failed accusing language_server_linux_arm doesn't exist

Hello, i tried to install codeium.vim on Neovim (using AstroVim) in Termux and got the following warnings:
Screenshot_20230118_213852_Termux
After executing :PackerSync

Screenshot_20230118_213736_Termux
When reopening neovim after :PackerSync

Although when i enter in that folder, i can find the file. I just can't execute it
Screenshot_20230118_214104_Termux

In case it's needed, here is some system info:
Screenshot_20230118_223917_Termux

FR: Option to disable in comments

when typing in a comment, I find suggestions in general not useful. At the same time, they are somewhat distracting. Could there be an option to disable codeium suggestions when typing inside a comment?

Getting dropped into Insert Mode using `Telescope`

cute-GfxOQ_2.mp4

To reproduce:

  1. enable codeium (as shown in the beginning of the video, auto-completion works)
  2. escape into Normal Mode
  3. trigger <cmd>lua require('telescope.builtin').git_files()<CR> with C-g for finding files in Telescope
  4. select target file
  5. get dropped into Insert Mode (as seen by my random typing dfdfdf)

After disabling codeium, I no longer have this issue.

Any input is much appreciated. Thank you.

Does not work when tries to use curl

Exception: Vim(return):E903: Process failed to start: argument list too long: "curl" [function codeium#Complete[42]..codeium#server#Request, line 14]
Exception: Vim(return):E903: Process failed to start: argument list too long: "curl" [function codeium#Complete[42]..codeium#server#Request, line 14]
Exception: Vim(return):E903: Process failed to start: argument list too long: "curl" [function codeium#Complete[42]..codeium#server#Request, line 14]

Inserting suggestions eats characters or lines

Hi, I've recently started using the Codeium plugin for neovim (nvim v0.8.3 on ubuntu 22.04), it's a great plugin that has been a tremendous help to my coding workflow. However, I've encountered an issue multiple times (at least 100 times, in rust/lua/go/typescript, etc.) where the plugin seems to be deleting lines or characters and sometimes even reversing the order of neighbouring lines when I insert a suggestion.

I have recorded a short video that demonstrates one of the problems. There are several other cases where similar issues have occurred.

simplescreenrecorder-2023-03-01_21.35.09.mp4

I'm not sure if this is a bug in the plugin or if I'm doing something wrong, but it's causing some frustration. I would appreciate it if you could take a look at this issue and provide some guidance or assistance.

Thank you for creating this plugin, it has been a great help to my coding, and I look forward to using it more in the future.

Security: Enable users to reset the API key

As a consequence of #16, my codium API key has now been published and therefore compromised, so I would like / should reset the key.

However, at https://www.codeium.com/profile, I do not see any setting that allows me to reset my API key.

Since the usage of the codium does not incur any costs, potential abuse of the API key does not have direct drawbacks for me, this is somewhat mitigated. so I can live with the fact that my API key is leaked for the time being – but it should nonetheless be very much in the interest of codium that I (and other affected users) are able reset their API keys.


This is probably an issue for codium in general and not the codium (n)vim plugin, but I could not find a GitHub repo for the service in general, therefore reporting it here. Will open an issue at the respective repo, if you can direct me to it

Plugin introducing a (control?) character into vim buffers

Description

I'm seeing a "report mode settings" control sequence-looking thing: ^[[?12;4$y inserted at the beginning of vim buffers when the plugin in activated in my vimrc via:

Plug 'Exafunction/codeium.vim'
imap <C-g>   <Cmd>call codeium#Accept()<CR>

I could be misconfiguring the plugin somehow, or using incompatible tools, but this seems to be bug in the vim plugin.

Current Workaround

The character goes away when I remove the plugin and imap call from my vimrc.

Versions

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Feb 24 2023 12:08:45)
macOS version - x86_64
Included patches: 1-1350

Iterm: Build 3.4.19

The executable never gets extracted on windows

The following code for downloading and extracting the executable (located in server.vim) does not work on windows since it doesn't have gzip nor chmod

  if empty(glob(bin))
    let url = 'https://github.com/Exafunction/codeium/releases/download/language-server-v' . s:language_server_version . '/language_server_' . bin_suffix . '.gz'
    call system('curl -Lo ' . bin . '.gz' . ' ' . url)
    call system('gzip -d ' . bin . '.gz')
    call system('chmod +x ' . bin)
    if empty(glob(bin))
      call codeium#log#Error('Failed to download language server binary.')
      return ''
    endif
  endif

Bug: No suggestions showing up at all

I have installed the plugin via lazy.vim with the suggested snippet in the README.

I ran :Codeium Auth, signed up, and entered the token.

Nothing happens. Restarting neovim or :Codium Enable do simply nothing.

tried the test.py example from the tutorial.


macOS 13.0.1 (M1)
neovim 0.8.2 (homebrew)
Neovide 0.10.3 (homebrew)

Ghosting of suggestion when leaving insert mode

I think an animation says more than 1000 words:

2023-04-01 8 08 25 PM

As you can see, when I cancel insert mode with CTRL+C while having a suggestion, there is only one way to get rid of the suggestion which I like to call ghost suggestion: I have to go back into insert mode at the point where the suggestion is.

As much as I like Codeium (my first impression gives me appeal and satisfaction), this is a bitter piece that ships with it. I often cancel insert mode somewhere, just delete my stuff and move along, but the suggestion will remain and occupy valuable space. It also causes a lot of confusion along the way.

Possible solution: Remove all suggestions when going back into normal mode. Suggestions should only be a thing in insert mode, they should not?

Text and completion is causing text drawning issues

Completion is interfering with typing and when using backspace.

During typing, it enters chars at the end of line, then redraw it correctly.
During using backspace, it puts remaining part of suggestion to the next line and everything below just "jumps".

Here is short video showing this behavior:

Screencast.2023-01-28.22.55.35.mp4

Originally posted by @klew in #42 (comment)

The token value is `undefined`.

I pasted the token in the commandline of neovim and notepad++, but the value is undefined

Screenshot (1341)

Screenshot (1342)

Terminal: Windows terminal
OS: Windows
Editor: Neovim

Thanks for the future response/s :)

Title: Limiting the number of processes in codeium.vim

I'm using codeium.vim on a server where I don't have root access. The service only allows users to run up to 200 processes. However, codeium.vim creates too many processes as shown in the attached image. I was wondering if there's a way to limit the number of processes created by Codium.

image

Thanks in advanece

can't start language_server_windows_x64.exe

Error detected while processing function codeium#server#Start[30]..<SNR>70_ActuallyStart:
line   14:
E903: Process failed to start: unknown error: "C:\Users\choij/.codeium/bin/daf4912ada2a4934c00b8c5a321cec4998a15e70/language_server_windows_x64.exe"

is printed as soon as I start Neovim and the plugin doesn't work

Environment:
Windows 11
neovim 0.8.3

Security: Do *not* store the API key in `~/.config` by default

I just discovered that codium by default and without informing the user stores its API key in the ~/.config directory (macOS).

Since many people, including me, make their dotfiles public as a repo on GitHub, this means that my API key has now been leaked. I removed the key from my dotfile repo, but if someone runs a crawler on GitHub repos, they now have my API key.

Storing API keys in directories intended for config files is generally not a good idea, because many people publish their dotfiles, which will inevitably result in API key leakages. API keys should only be stored in directories intended for user data, not user config for this reason.

I only noticed that this happend since I installed the codium plugin on my home device and was surprised that it worked out of the box without needing to authenticate. I am pretty sure that other people, who also publish their dotfiles, now also have their API keys leaked, they only probably did not notice it yet.

unable to disable "<Tab> for accept"

My config as shown below doesn't work, i.e., when I click the tab key, auto suggestion is still accepted.

May I ask if my config is correct?

    use {
        'Exafunction/codeium.vim',
        config = function ()
            vim.g.codeium_disable_bindings = true
            vim.g.codeium_no_map_tab = true
            vim.keymap.set('i', '<c-g>', function() return vim.fn['codeium#Accept']() end, { expr = true })
            vim.keymap.set('i', '<c-/>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true })
            vim.keymap.set('i', '<c-;>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true })
            vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true })
        end
    }

Not working in neovim Termux

it's not working in neovim termux, on the statusline it says ON but the autocomplete never appears.
but when i run my laptop in termux under ssh it's working, Maybe there are dependencies that are not installed yet in termux, but I don't know

Virtualtext hides what I'm typing

Hi!
I've been trying out codeium and codeium.nvim, and there's one thing that's very problematic, I'm not sure if it's a setting on my side or a more generalized problem, but when I get a suggestion and decide not to go with it, if I start typing, I can't see what I'm typing because the suggestion stays on top of that.
Here's a video showing what I'm describing:

2023-03-07.21-59-38.mp4

Additionally, it seems to fight with LSP syntax errors.
image
image

nvim-cmp, coc.nvim, coq.nvim and other completion engines

NeoVIM, the same as VIM has quite a few completion plugins. It would be great to have nvim-cmp support or even X support.

It would be awesome to get either API or the boilerplate invocation code to integrate Codeium with the other completion plugins.

By boilerplate, I mean a code that would show how to properly setup the prerequisites, start, and interact with Codeium.

Thank you.

Add option to not show suggestions unless manually triggered

Having some experience of using copilot and codeium, I found that the most productive way of using tools like these involves disabling automatic suggestions and only show them in specific places by manually triggering them.

However, with codeium I can't easily achieve this: when I set let g:codeium_enabled = v:false, the "Manually trigger suggestion" action dosen't work anymore.

Using `s:server_job` in another script

autoload/codeium/server.vim defines s:server_job and autoload/codeium.vim uses s:server_job but s:... means script scope variable.

Error on exit: (:redir! > log.txt)

Error detected while processing VimLeave Autocommands for "*"..function codeium#ServerLeave:
line    1:
E121: Undefined variable: s:server_job

Invalid id token

hi, I open the browser, but get the below situation. Any help? Thx.
image

Invalid token please try again

I installed the codeium.vim , and the service has been downloaded normally. In neovim, I executed the Codeium Auth command to open the window to get the token. Paste the token, but it prompts Invalid token, please try again

Hangging after install this plugin.

Just after installing this plugin, My neovim in WLS just hanging. It just stopped responding to anything. I guess that it may downloading the codeium server. But It just stops the whole NeoVim, maybe there are better way to deal with this. Thx!

Not working in Podman container in WSL

Is there any known issues that it won't work in containers/WSL? Is there anyway to check status, say something like:
:codeium status so that it says all okay?

Context:

  • Installed in Neovim 0.6
  • :checkhealth is all okay
  • :Codeium Auth prompted for key & looked like it was accepted

Question about s:RenderCurrentCompletion

The second condition of the following code is to determine whether the pop menu is currently open, why add a v:false to pumvisible(), so that it will always be false no matter what pumvisible() returns

  if mode() !~# '^[iR]' || (v:false && pumvisible())
    return ''
  endif

[Feature] Word-by-word autocompletion

Copilot is actually missing this essential feature.

Please implement a hotkey so that it can be possible to autocomplete one word at a time from the one suggested by the plugin, by still displaying the whole suggestion with the grey "ghost" text, which will of course update itself whenever a user changes the next suggested word to something else.

Suggested code has trailing ^M

  • Environment
    Windows 11 22H2 22621.1105
    Windows Terminal
    NVIM v0.8.3

  • Description
    Code suggestion shows ^M characters at the end of each line.
    Accepted code also has ^M at the end of each line

  • Expected
    Code suggestions and accepted code contain no trailing ^M

  • Steps to repro

  1. nvim fib.py
  2. Type def fib(n):
  3. See the bug
  • Screenshot
    fibonacci

  • Notes
    Possibly showing carriage-return characters Windows uses for line breaks

Custom Keybindings/Completions

Hi 👋 ,

Thanks for this great plugin, it's important to have a free CoPilot alternative!

Would it be possible to

  • provide the respective commands for codeium-dismiss, codeium-next and codeium-previous?
  • disable auto completion (per configuration), i.e. only show suggestions when a user triggers codeium-next/codeium-previous?
  • disable the default keymaps (per configuration)?

Thanks again and best regards,
David

Remove the redrawstatus makes plugin not flicker in neovim

Hi there,

Trying out the plugin and got a bit annoyed by the flicker when I accept a completion. Commenting out the redrawstatus lines in the code works. Not ideal, but I don't have codeium in my statusline anyway. Maybe if you move this line somewhere else it remove the flickering and can still redraw the statusline?

Thanks!
Hans

Neovim-native Plugin

I'm not sure what you'll do with this, but I have created a plugin specifically for Neovim and nvim-cmp: https://github.com/jcdickinson/codeium.nvim/

If you want to migrate it into the Exafunction org, I'm cool with that. If you want to link to it, I'm cool with that also. If you don't want to mention it at all, that's also fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.