Skip to content

Instantly share code, notes, and snippets.

@treatmesubj
treatmesubj / Duckdb.lua
Last active April 24, 2025 19:14
Neovim DuckDB Plugin
-- inspired by
-- https://gist.github.com/Leenuus/7a2ea47b88bfe16430b42e4e48122718
-- https://gist.github.com/romainl/eae0a260ab9c135390c30cd370c20cd7
local function results_pane(output)
vim.opt_local.winbar = nil
local new_buf = vim.api.nvim_create_buf(true, false)
if output.code == 0 then
vim.api.nvim_set_option_value("ft", "csv", { buf = new_buf})
vim.api.nvim_buf_set_lines(new_buf, 0, -1, false, vim.fn.split(output.stdout, "\n"))