chatter.nvim is a Neovim plugin that provides a chat interface powered by AI models. It allows users to interact with AI models seamlessly within Neovim, featuring a sidebar for chat history, code block highlighting, and more.
- AI Chat Interface: Start a chat with AI models directly in Neovim.
- Sidebar Display: View chat history in a dedicated sidebar.
- Code Block Highlighting: Automatically highlights code blocks using Treesitter.
- [WIP] Clipboard Support: Easily copy code blocks to the clipboard.
- Customizable Keymaps: Configure key mappings to suit your workflow.
- Lazy Loading Support: Integrates with
lazy.nvimfor efficient loading.
ollamainstalled on your os.fzf-luafor selection of local LLMs.
To install chatter.nvim with lazy.nvim, add the following to your Neovim configuration:
{
"Dan7h3x/chatter.nvim",
event = "VeryLazy",
dependencies = {
'nvim-lua/plenary.nvim',
"ibhagwan/fzf-lua",
},
keys = { {
"<leader>cc", "<Cmd>ChatterStart<CR>", desc = "Chatter Start"
}, },
config = function()
require('chatter').setup({
offline_api_url = os.getenv("OLLAMA_HOST") or "http://localhost:8888",
sidebar_width = 60,
sidebar_height = vim.o.lines - 12,
models = {},
highlight = {
title = "Title",
user = "Comment",
assistant = "String",
system = "Type",
error = "ErrorMsg",
loading = "WarningMsg",
}
})
end,
}If you prefer to install manually, clone the repository into your Neovim plugins directory:
git clone https://github.com/Dan7h3x/chatter.nvim.git ~/.config/nvim/lua/chatterThen, add the following to your init.lua or init.vim:
require("chatter").setup()- Open the Chat Interface: Use the command
:ChatterToggleto open or close the chat sidebar. - Start a Chat: Use the command
:ChatterStartto initiate a chat session. - Send Messages: Press
ito enter your message and hit Enter to send. - [WIP] Copy Code Blocks: Navigate to a code block and press
ycto copy it to the clipboard. - Clear Chat: Use the command
:ChatterClearto clear the chat history.
The following key mappings are available by default:
i: Enter message input- [WIP]
yc: Copy the current code block to clipboard q: Close the chat sidebar automatically<C-c>: Clear the chat.<C-r>: Reload thechatter.nvimfor selecting another model.
Available commands are ChatterStart,ChatterToggle,ChatterClear,ChatterRestart,ChatterSend.
Contributions are welcome! Please feel free to submit issues or pull requests. Make sure to follow the contribution guidelines.
This project is licensed under the MIT License. See the LICENSE file for details.
- Neovim - The extensible Vim-based text editor.
- Treesitter - For syntax highlighting.
- Lazy.nvim - For efficient plugin loading.



