A Neovim plugin for efugier/smartcat
- Ask questions and get AI responses directly within Neovim
- Context-aware queries using visual selection
- Extend existing conversations
- Easy navigation between response buffers
- Markdown formatting for responses
- Configurable split behavior and keymaps
- Install the smartcat CLI tool (follow instructions at efugier/smartcat)
- Install the plugin using your favorite package manager:
Using lazy.nvim:
{
"bytesoverflow/smartcat.nvim",
opts = {}
},
Using packer.nvim:
use 'bytesoverflow/smartcat.nvim'
- Setup the plugin in your
init.lua
(not needed with lazy.nvim ifopts
is set):
require("smartcat").setup()
Default keybindings:
<Leader>ai
(normal mode) Ask a new question<Leader>ai
(visual mode) Ask about selected text<Leader>ae
(in response buffer) Extend the current conversation<Leader>al
List and navigate between response buffers
-
Ask a general question:
- Press
<Leader>ai
- Type your question
- Response appears in a new split
- Press
-
Ask about code:
- Select code in visual mode
- Press
<Leader>ai
- Type your question
- Response appears in a new split
-
Continue a conversation:
- In a response buffer, press
<Leader>ae
- Type your follow-up
- Response appears in the same buffer
- In a response buffer, press
Starting the input with -template question text
will use that template from the smartcat config.
You can pass your config table into the setup()
function or opts
if you use lazy.nvim.
require("smartcat").setup({
split_direction = "vertical",
split_size = 80,
mappings = {
ask = "<leader>ai",
extend = "<leader>ae",
list = "<leader>al",
},
spinner = {
frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
text = "Thinking...",
},
})
Contributions are welcome! Please feel free to submit a Pull Request.