aduros / ai.vim

Generate and edit text in Neovim using OpenAI and GPT.
ISC License
291 stars 24 forks source link

FR: Custom location of file with OpenAI API Key #3

Open chrisgrieser opened 1 year ago

chrisgrieser commented 1 year ago

Being able to define a custom location of a file containing the API key would be useful for those of us who made their dotfiles public.

The workaround right now is to set it via vim.env outside of the dotfiles repo, and symlink that file into the nvim config, which is unnecessarily many hoops to jump through just to get it set up.

aduros commented 1 year ago

Sounds good to me. I'm feeling like moving the API key to a file instead of an env var by default would make more sense. Maybe defaulting to ~/.config/nvim/.openai_key with an option to override the file path?

chrisgrieser commented 1 year ago

yeah, that sounds good to me!