Exafunction / codeium.nvim

A native neovim extension for Codeium
MIT License
658 stars 50 forks source link

feat: adding plugin toggle functionality via keymap #42

Open zettlrobert opened 1 year ago

zettlrobert commented 1 year ago

Hey there, I'm interested in contributing to the development of the codeium plugin by adding toggle functionality via a keymap.

My plan is to use a global variable codium_enabled and modify the setup() function in init.lua to return if the codium_enabled global variable is set to false.

When the global variable is toggled to true, I would run vim.api.nvim_command('packadd codeium') or something similar to toggle a function to reload the plugin.

I'm hoping to get some guidance on how and if you would like that feature implemented.

Thanks for your help

jcdickinson commented 1 year ago

Sure, contributions are always welcome. It's extremely likely that packadd would require vimscript stuff, which this plugin doesn't use at all right now.

Something along the lines of this might work better: https://gitlab.com/jcdickinson/nix/-/blob/main/home/files/nvim/lua/jcdickinson/automation.lua. I would export this functionality as a user command, as well as simple lua methods (which my example doesn't do).

Although I am wondering if it's possible to disable the source through nvim-cmp.

zettlrobert commented 1 year ago

Thanks for your response, hopefully I find time during the upcoming Easter holiday to give it a go.

I also give your automation file a look and try to keep it strictly lua, thanks for your input!

It should be possible to disable the source or at least 'mock' turning it off by pointing to an empty one.