diff --git a/lua/autocommands.lua b/lua/autocommands.lua index d18a313..bfea6d8 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -53,3 +53,16 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, { -- if ts_avail and parsers.has_parser() then vim.cmd.TSBufEnable "highlight" end -- end, --}) + +vim.api.nvim_create_autocmd("VimLeavePre", { + callback = function() + vim.cmd("NvimTreeClose") + -- Close all buffers with the 'httpResult' type + local buffers = vim.api.nvim_list_bufs() + for _, bufnr in ipairs(buffers) do + if vim.bo[bufnr].filetype == "httpResult" then + vim.api.nvim_buf_delete(bufnr, { force = true }) + end + end + end, +}) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 75fd2a6..88354d3 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -40,7 +40,7 @@ require("util").keymaps({ desc = "Quit", mode = nvx, }, - { "Q", "NvimTreeCloseqa", desc = "Quit all", mode = nvx }, + { "Q", "qa", desc = "Quit all", mode = nvx }, -- { "Q", "qa", desc = "Quit all", mode = nvx }, { "Q", "", mode = nvx }, -- don't do normal Q quit {