simplezen.nvim is a lightweight Neovim plugin designed to provide a distraction-free "Zen Mode" for focused coding and writing. It centers your current buffer, hides various UI elements, and creates seamless margins to create a clean, minimalist editing environment. All settings are restored when Zen Mode is toggled off.
Features:
- Content Centering: Centers your current buffer by creating dynamic margins.
- Distraction-Free UI: Hides
laststatus,showmode,ruler, andshowtabline. - Configurable Width: Allows you to set your preferred content width.
- State Restoration: Restores all original global and window-local settings upon exit.
- Auto-Resizing: Adjusts margins automatically when Neovim window is resized.
return {
{
"tuffgniuz/simplezen", -- Or your actual GitHub username/repo name
config = function()
require("simplezen").setup({
text_width = 100, -- Optional: Customize your preferred text width (default is 110)
})
end,
keys = {
{ "<leader>zz", "<cmd>lua require('simplezen').toggle()<CR>", desc = "Toggle Zen Mode" },
},
},
}Once installed, you can toggle Zen Mode on and off using the M.toggle() function. If you've set up the keybinding as shown in the installation example, simply press <leader>zz (or your chosen keybind).
<leader>zz: Toggles Zen Mode on/off.
simplezen.nvim can be configured via its setup() function. The available options are:
text_width(number, default: 110): The maximum width for your centered text content.
Example Configuration:
require("simplezen").setup({
text_width = 90, -- Set content width to 90 characters
})simplezen.nvim is currently under active development. While efforts are made to ensure stability, bugs or unexpected behavior may occur. Your feedback and contributions are welcome!