fix(keymaps): fall back to :q when :wq fails on bufferless windows

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-05-21 16:15:18 +02:00
parent 547c997614
commit 95617dd673
1 changed files with 4 additions and 1 deletions

View File

@ -97,7 +97,10 @@ vim.keymap.set("n", "t", ":FloatermNew<CR>", { silent = true })
vim.keymap.set("n", "e", ":NERDTreeToggle<CR><C-W>l", { silent = true })
vim.keymap.set("n", "s", ":DBUIToggle<CR>", { silent = true })
vim.keymap.set("n", "x", "<Plug>(DBUI_ExecuteQuery)", { remap = true })
vim.keymap.set("n", "q", ":wq<CR>", { silent = true })
vim.keymap.set("n", "q", function()
local ok = pcall(vim.cmd, "wq")
if not ok then vim.cmd("q") end
end, { silent = true })
-- insert mode completion
vim.keymap.set("i", "<TAB>", "<C-N>")