From 24b940810ef2aa56d6a897c8b18dcaebcfeb3c71 Mon Sep 17 00:00:00 2001 From: Daniel Fainberg Date: Tue, 15 Sep 2026 12:56:55 +0200 Subject: [PATCH] feat(nvim): prompt to save on `Q` instead of aborting `:qa` fails with E37 when any buffer is modified, leaving the quit dead-ended. `:confirm qa` asks Save/Discard/Cancel per modified buffer, which neither strands the user nor writes unintended edits the way `:wqa` would. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015D4NsszUG7hy9ghKZ4nfhm --- modules/nvim.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nvim.nix b/modules/nvim.nix index 391fbc4..9f3bfed 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -263,7 +263,9 @@ in keymaps = [ { mode = "n"; key = "w"; action = "w"; options.desc = "Save"; } { mode = "n"; key = "q"; action = "q"; options.desc = "Quit window"; } - { mode = "n"; key = "Q"; action = "qa"; options.desc = "Quit all (exit nvim)"; } + # `confirm` prompts Save/Discard/Cancel per modified buffer rather than + # aborting with E37, so quitting never dead-ends and never writes silently. + { mode = "n"; key = "Q"; action = "confirm qa"; options.desc = "Quit all (prompt to save)"; } # Restore the saved session for the current directory (persistence.nvim). { mode = "n"; key = "S"; action.__raw = "function() require('persistence').load() end"; options.desc = "Restore session"; } { mode = "n"; key = "e"; action = "Neotree toggle"; options.desc = "File tree"; }