---
title: "zen.lua"
date: "12/12/2025"
---

[zen-mode.nvim](https://github.com/folke/zen-mode.nvim), no plugin needed.

```lua
local state = nil

map({'n', '<leader>iz', function()
  local o = vim.opt
  if state then
    for k, v in pairs(state) do o[k] = v end
    state = nil
  else
    state = {
      number = o.number:get(),
      relativenumber= o.relativenumber:get(),
      signcolumn = o.signcolumn:get(),
      statuscolumn = o.statuscolumn:get(),
      laststatus = o.laststatus:get(),
      cmdheight = o.cmdheight:get(),
    }
    o.number = false
    o.relativenumber = false
    o.signcolumn = "no"
    o.statuscolumn = ""
    o.laststatus = 0
    o.cmdheight = 0
  end
end})
```
