chat.nvim is a lightweight, extensible chat plugin for Neovim with AI integration.
Chat with AI assistants directly in your editor using a clean, floating window interface.
It supports 19+ AI providers, a three-tier memory system, 40+ built-in tools,
MCP protocol, IM integrations, and an HTTP API for external access.
Full documentation is available at nvim.chat.
chat.nvim works with all major Neovim plugin managers.
Using lazy.nvim
{
'wsdjeg/chat.nvim',
dependencies = {
'wsdjeg/job.nvim', -- Required
'wsdjeg/picker.nvim', -- Optional but recommended
},
}
Using nvim-plug
require('plug').add({
{
'wsdjeg/chat.nvim',
depends = {
'wsdjeg/job.nvim',
'wsdjeg/picker.nvim',
},
},
})
Using luarocks
luarocks install chat.nvim
The following is the default configuration of chat.nvim. See the Configuration Guide for full details.
require('chat').setup({
-- window options
width = 0.8,
height = 0.8,
auto_scroll = true,
border = 'rounded',
-- default AI provider and model
provider = 'deepseek',
model = 'deepseek-v4-flash',
-- time display format
strftime = '%m-%d %H:%M:%S',
-- display names for the AI and user, used in the chat window
-- and on role badges in the HTML preview
names = {
bot = 'Bot',
user = 'You',
},
-- enable RenderMarkdown for result buffer
render_markdown = true,
-- default system prompt
system_prompt = '',
-- HTTP server for external integration
http = {
host = '127.0.0.1',
port = 7777,
api_key = '', -- set to non-empty to enable
},
-- API keys for providers
api_key = {
deepseek = 'your-deepseek-api-key',
openai = 'your-openai-api-key',
-- ...
},
})
Open the chat window:
:Chat
Switch provider or model with slash commands (in the prompt window):
/provider openai
/model gpt-4o
Or use picker.nvim keybindings (in the input window):
| Key Binding | Action |
|---|---|
<Leader>fp |
Switch provider via picker |
<Leader>fm |
Switch model via picker |
<Leader>fr |
Browse session history via picker |
Navigate between sessions:
:Chat prev
:Chat next
See the Usage Guide for all commands and keybindings.
chat.nvim implements a three-tier memory system:
| Type | Lifetime | Purpose |
|---|---|---|
| Working | Session | Current context, decisions, active tasks |
| Daily | 7-30 days | Tasks, reminders, schedules |
| Long-term | Permanent | Preferences, facts, skills |
Memories are automatically extracted during conversations and retrieved with priority-based ranking. See the Memory Guide for details.
40+ built-in tools are available for AI assistants to interact with your environment:
Tools are lazy-loaded by default: only the essential tools plus a find_tool discovery
catalog are sent with each request to save prompt tokens, and other tools are activated
on demand for the current turn. Set tools.lazy = false to send all tools with every
request.
See the Tools Guide for the full list and usage.
Native Model Context Protocol support for extended tool capabilities:
require('chat').setup({
mcp = {
servers = {
-- stdio transport
filesystem = {
command = 'npx',
args = { '-y', '@modelcontextprotocol/server-filesystem', '/path/to/dir' },
},
-- HTTP transport
remote = {
url = 'http://localhost:3000/mcp',
},
},
},
})
See the MCP Guide for details.
Connect messaging platforms for remote AI interaction:
See the Integrations Guide for setup instructions.
The built-in HTTP server allows external applications to send messages to chat.nvim:
curl -X POST http://127.0.0.1:7777/ \
-H "Content-Type: application/json" \
-H "X-API-Key: your-secret-api-key" \
-d '{"content":"Hello","session":"default"}'
See the API Guide for all endpoints.
If you like this plugin, please star it on GitHub. Also check out my other Neovim plugins:
If you encounter any bugs or have suggestions, please file an issue in the issue tracker
Licensed under GPL-3.0.