nvim: Stay centered in zen mode

By default we always stay centered in zen mode, like using a typewriter.
The old zen mode can still be reached with `[sZ` (capital Z).
This commit is contained in:
Marty Oehme 2025-07-16 18:25:23 +02:00
parent 368a6fcb37
commit 168475a988
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 21 additions and 2 deletions

View file

@ -86,6 +86,7 @@
"rainbow-delimiters.nvim": { "branch": "master", "commit": "1ab18259472d9fe5756750fec722c31bab1712da" },
"render-markdown.nvim": { "branch": "main", "commit": "6d03af10063d5a2fadec3559de5dfa68da7d00ef" },
"smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" },
"stay-centered.nvim": { "branch": "main", "commit": "e1a63ccaf2584e97c0ef8e64f9654c9a80d983f6" },
"stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" },
"texpresso.vim": { "branch": "main", "commit": "907838c08bbf99ad6bed3c908f1d0551a92ab4e0" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },

View file

@ -33,10 +33,28 @@ local prose_plugs = {
"folke/zen-mode.nvim",
config = true,
cmd = { "ZenMode" },
dependencies = { "folke/twilight.nvim" },
dependencies = { "folke/twilight.nvim", { "arnamak/stay-centered.nvim", opts = { enabled = false } } },
keys = {
{
"[sz",
function()
require("zen-mode").close()
require("stay-centered").disable()
end,
silent = true,
desc = "stop center zen mode",
},
{
"]sz",
function()
require("zen-mode").open()
require("stay-centered").enable()
end,
silent = true,
desc = "start center zen mode",
},
{
"[sZ",
function()
require("zen-mode").close()
end,
@ -44,7 +62,7 @@ local prose_plugs = {
desc = "stop zen mode",
},
{
"]sz",
"]sZ",
function()
require("zen-mode").open()
end,