add zen-mode config for wezterm
This commit is contained in:
@@ -7,6 +7,30 @@ wezterm.on("gui-startup", function()
|
||||
window:gui_window():maximize()
|
||||
end)
|
||||
|
||||
-- required to allow nvim zen-mode to change the font size
|
||||
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)
|
||||
|
||||
config = {
|
||||
window_close_confirmation = "NeverPrompt",
|
||||
term = "xterm-256color",
|
||||
|
||||
Reference in New Issue
Block a user