Exafunction / codeium.vim

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

codeium creating $HOME/.codeium folder even though $XDG vars are set #290

Open yatinlala opened 6 months ago

yatinlala commented 6 months ago

I'm running the latest version of codeium.vim with NVIM v0.9.4.

Here's my current configuration, using lazy.

return {
    'Exafunction/codeium.vim',
    event = 'BufEnter',
    dependencies = {
        'nvim-lua/plenary.nvim',
        'hrsh7th/nvim-cmp',
    },
    config = function()
        vim.g.codeium_enabled = false
    end,
}

Looking through the source code it seems that codeium attempts to respect XDG basedir specs if $XDG vars are set:

Running :echo $XDG_CONFIG_HOME or :echo $XDG_DATA_HOME in neovim returns the folders I'd expect. Despite this, I'm still getting a .codeium folder created in my home directory, and no configuration information is being stored in ~/.local/share/ or ~/.config as expected.

I'm not sure exactly how to debug this, or perhaps this is intended behaviour. Please let me know if there is any information I can provide to resolve this.

pqn commented 6 months ago

This is probably expected behavior, we need to make sure our language server binary also respects these variables. It won't be used for anything though since chat isn't yet supported in this IDE.

yatinlala commented 5 months ago

I was mistaken, looks like I'm getting a .codeium folder in $XDG_DATA_HOME as well. Would be nice to strip the . if the codeium folder is not being made in the home directory, and unify all the data together there.

Alternatively, allowing the user to set a spoof env var like $CODEIUM_HOME could work, moving the .codeium folder that currently spawns in ~.

I'd imagine that the first solution would require modifying more than just the plugin code, and the changes here would be fairly trivial so I'll hold off on a PR 🙂. Would be nice to have this fixed eventually and have a clean home folder again.

forlornidealist commented 4 months ago

I'm using neovim and have $XDG vars set. Most files, including the config, are placed in $XDG_DATA_HOME/.codeium (I agree it would be nice to strip the "." here).

However, 3 sqlite files are still placed in $HOME/.codeium: ~/.codeium/database/default/2/MODEL_EMBED_6591/embedding_database.sqlite ~/.codeium/database/default/2/MODEL_EMBED_6591/embedding_database.sqlite-shm ~/.codeium/database/default/2/MODEL_EMBED_6591/embedding_database.sqlite-wal