feat: initial release
This commit is contained in:
17 files changed
+279
No files matched your search
@@ -0,0 +1,40 @@
|
||||
local M = {}
|
||||
|
||||
function M.setup(opts)
|
||||
opts = opts or {}
|
||||
local filetypes = opts.filetypes
|
||||
or {
|
||||
"checkhealth",
|
||||
"help",
|
||||
"lspinfo",
|
||||
"man",
|
||||
"neotest-output",
|
||||
"neotest-output-panel",
|
||||
"neotest-summary",
|
||||
"notify",
|
||||
"qf",
|
||||
"query",
|
||||
"startuptime",
|
||||
}
|
||||
local group = vim.api.nvim_create_augroup("tiny-shoo", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = group,
|
||||
pattern = filetypes,
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("WinEnter", {
|
||||
group = group,
|
||||
callback = function()
|
||||
if vim.fn.winnr("$") == 1 and vim.bo.buftype == "quickfix" then
|
||||
vim.cmd("quit")
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in new issue
Block a user