neovim: add zen-mode

This commit is contained in:
Alexandre Cavalheiro 2024-07-09 06:35:04 -03:00
parent ab00ada734
commit b264921aa5
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
2 changed files with 25 additions and 0 deletions

View file

@ -16,6 +16,7 @@ return {
},
{ import = "astrocommunity.editing-support.todo-comments-nvim" },
{ import = "astrocommunity.editing-support.zen-mode-nvim" },
{ import = "astrocommunity.motion.flash-nvim" },
{ import = "astrocommunity.motion.flit-nvim" },

View file

@ -7,6 +7,30 @@
''
local wezterm = require("wezterm")
-- Needed for folke's ZenMode in neovim
wezterm.on('user-var-changed', function(window, pane, name, value)
local overrides = window:get_config_overrides() or {}
if name == "ZEN_MODE" then
local incremental = value:find("+")
local number_value = tonumber(value)
if incremental ~= nil then
while (number_value > 0) do
window:perform_action(wezterm.action.IncreaseFontSize, pane)
number_value = number_value - 1
end
overrides.enable_tab_bar = false
elseif number_value < 0 then
window:perform_action(wezterm.action.ResetFontSize, pane)
overrides.font_size = nil
overrides.enable_tab_bar = true
else
overrides.font_size = number_value
overrides.enable_tab_bar = false
end
end
window:set_config_overrides(overrides)
end)
return {
color_scheme = "Catppuccin Frappe",
enable_wayland = false, -- Unfortunately broken on Hyprland, AGAIN