-- Write all we can and exit. Created this to drop non-writable stuff when piping to nvim. function bye() pcall(vim.cmd, "wa") vim.cmd([[qa!]]) end -- Save everything. rekey_normal("", "wa!") rekey_input("", "wa!") -- Save all we can and leave. rekey_normal("z", "lua bye()") -- Just leave, no saves. rekey_normal("Z", "qa!")