From e3ce9d4746b28943cbd07f1d4fe1de1cf321bd96 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 10 Mar 2023 16:51:43 +0000 Subject: [PATCH] Set scrolloff in zen mode to keep current line centered when possible --- config/nvim/lua/config/zen_mode.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/nvim/lua/config/zen_mode.lua b/config/nvim/lua/config/zen_mode.lua index de77cc82..9594b0bf 100644 --- a/config/nvim/lua/config/zen_mode.lua +++ b/config/nvim/lua/config/zen_mode.lua @@ -18,4 +18,10 @@ return { gitsigns = { enabled = true }, tmux = { enabled = true }, }, + on_open = function (win) + vim.wo.scrolloff = 999 + end, + on_close = function (win) + vim.wo.scrolloff = 0 + end }