AI-Powered Chat and Code Assistance for Neovim
- Use your preferred models. We use Open Router API so you can choose whatever model you like.
- Add buffer(s) to the LLM context
- Add url(s) to the LLM context
- Add errors in the buffer(s) to the LLM context
- Configure your own prompt
- Neovim 0.7+
- OpenRouter API Key
- Dependencies:
plenary.nvim
nvim-notify
nui.nvim
Using lazy.nvim:
{
'uanandaraja/nvim-llm.nvim',
requires = {
'nvim-lua/plenary.nvim',
'rcarriga/nvim-notify',
'MunifTanjim/nui.nvim',
},
config = function()
require('nvim-llm').setup()
end
}
require('nvim-llm').setup({
-- Optional custom configuration
default_model = "anthropic/claude-3.5-sonnet",
system_prompt = "You are a helpful coding assistant."
})
<leader>lo
: Open LLM Chat<leader>ls
: Submit prompt<leader>lc
: Clear chat<leader>lq
: Quit chat<leader>lf
: Add file reference<leader>lb
: Add current buffer<leader>lm
: Select Model<leader>lu
: Add URL reference<leader>lp
: Configure system prompt
- First time: You'll be prompted for an OpenRouter API key
- Open chat with
:LLM
or<leader>lo
- Type your prompt
- Use keybindings to add context (files, URLs, errors)
- Submit with
<leader>ls
- Obtained from OpenRouter
- Securely stored in Neovim data directory
- Can be updated anytime
Apache License
- Document the config better so people could do whatever they want