A neovim plugin for generating texts using Google Gemini APIs.
{
'meinside/gemini.nvim', config = function()
require'gemini'.setup {
-- (default values)
configFilepath = '~/.config/gemini.nvim/config.json',
timeout = 30 * 1000,
model = 'gemini-1.0-pro',
safetyThreshold = 'BLOCK_ONLY_HIGH',
stripOutermostCodeblock = function()
return vim.bo.filetype ~= 'markdown'
end,
verbose = false,
}
end,
dependencies = { { 'nvim-lua/plenary.nvim' } },
},
Get your API key from here
and create a JSON config file at path configFilepath
with following content:
{
"api_key": "AI0123456789-abcdefg-XYZW"
}
Run following command with a prompt:
:GeminiGenerate your prompt text here
It will generate a text from your prompt and insert it at the current cursor position.
Select a range of text with visual block, and run following command:
:'<,'>GeminiGenerate
then it will generate a text from the selected text as a prompt, and replace the range with the generated one.
Select a range of text with visual block, and run following command with a prompt:
:'<,'>GeminiGenerate your prompt text here
then it will generate a text from both the selected text and prompt, and replace the range with the generated one.
- Add screen recordings for each usage.
- Strip unwanted markdown codeblock around the generated texts.
- Add an option for setting safety threshold.
- Handle multiple number of candidates and content parts.
- Add nice UIs for comparing & applying generated texts.
MIT