neovim/lua/aichat.lua
2025-12-30 01:31:05 -06:00

12 lines
459 B
Lua

map("n", "<leader>aa", function()
Snacks.input.input({ prompt = "Enter prompt" }, function(value)
if value ~= nil then
vim.cmd(":read !aichat -c " .. value .. " /nothink")
-- local output = vim.fn.system("!aichat -c " .. value .. " /nothink")
-- local lines = vim.split(output, "\n", { plain = true })
-- local bufnr = target_bufnr or vim.api.nvim_get_current_buf()
-- vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines)
end
end)
end)