Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding plugin toggle functionality via keymap #42

Open
zettlrobert opened this issue Apr 5, 2023 · 2 comments
Open

feat: adding plugin toggle functionality via keymap #42

zettlrobert opened this issue Apr 5, 2023 · 2 comments

Comments

@zettlrobert
Copy link

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
Copy link
Contributor

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants