require("zen-mode").setup { -- your configuration comes here -- or leave it empty to use the default settings -- refer to the configuration section below } vim.keymap.set("n", "z", function() require("zen-mode").toggle({ window = { width = 90 }, on_open = function(win) vim.opt.wrap = true vim.opt.relativenumber = false end, -- callback where you can add custom code when the Zen window closes on_close = function() vim.opt.wrap = false vim.opt.relativenumber = true end, }) end)