Skip to content

On-demand AI integration for Neovim. Send, replace, and prompt code with ease.

License

Notifications You must be signed in to change notification settings

KroneCorylus/InvokeAI.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InvokeAI.nvim

On-demand AI integration for Neovim. Send, replace, and prompt code with ease.

Setup

Install

Lazy.nvim
{
  "KroneCorylus/InvokeAI.nvim",
  opts = {
    ---Your configuration options here.
  },
}

Configuration

Key Type Default Description
key string nil Your API Key
key_fn fun():string nil A function that returns your API Key

Keymaps and usage examples

-- Manual prompt examples
vim.keymap.set('v', '<Leader>ip', require('invokeai').popup, { desc = "Ask AI and get response in floating window" })

vim.keymap.set('v', '<Leader>ir', function()
  require('invokeai').popup({ resolve_fn = require("invokeai.resolvers.replace") })
end, { desc = "Ask AI and replace selected text with response" })

-- Predefined prompt examples
vim.keymap.set('v', '<Leader>it', function()
  require('invokeai').pre_prompt(
    "Add the correct type annotations",
    { resolve_fn = require("invokeai.resolvers.replace") })
end, { desc = "Ask for type annotations and replace selected text with response" })

About

On-demand AI integration for Neovim. Send, replace, and prompt code with ease.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages