Skip to content

Instantly share code, notes, and snippets.

@raylee
Created September 7, 2022 18:08
Show Gist options
  • Save raylee/81b6a4cc3f0f2a84a07a2a46c7434e26 to your computer and use it in GitHub Desktop.
Save raylee/81b6a4cc3f0f2a84a07a2a46c7434e26 to your computer and use it in GitHub Desktop.
local wezterm = require 'wezterm'
--~~ customizing themes for translucency
local nordCoal = wezterm.get_builtin_color_schemes()['nord']
nordCoal.background = '#000000'
wezterm.on('toggle-opacity', function(window, pane)
local overrides = window:get_config_overrides() or {}
local opacity = overrides.window_background_opacity or 1
opacity = opacity + 0.5/8
overrides.window_background_opacity = opacity > 1 and 0.5 or opacity
window:set_config_overrides(overrides)
end)
wezterm.on('toggle-theme', function(window, pane)
local themes = {'nord-light', 'nordfox', 'nord-coal'}
local overrides = window:get_config_overrides() or {}
local themeID = (((overrides.themeID or 1) + 1) % #themes) + 1
overrides.themeID = themeID
overrides.color_scheme = themes[themeID]
window:set_config_overrides(overrides)
end)
--~~ clockwise (crtl-shift-]) and counter-clockwise (c-s-[) pane activation
-- wezerm.on('next-pane', function(window, pane)
-- get the centers, sort them by angle around their centroid, move forward or backward
-- https://wezfurlong.org/wezterm/config/lua/PaneInformation.html
-- https://wezfurlong.org/wezterm/config/lua/keyassignment/PaneSelect.html
-- https://wezfurlong.org/wezterm/config/lua/keyassignment/ActivatePaneByIndex.html
-- https://wezfurlong.org/wezterm/config/lua/keyassignment/ActivatePaneDirection.html
-- end)
return {
window_decorations = "RESIZE",
default_cursor_style = 'BlinkingBar',
animation_fps = 2,
cursor_blink_ease_in = 'Constant',
cursor_blink_ease_out = 'Constant',
hide_tab_bar_if_only_one_tab = true,
tab_bar_at_bottom = true,
color_schemes = {
['nord-coal'] = nordCoal,
},
color_scheme = 'Nord Coal',
-- font = wezterm.font 'MesloLGS NF',
font = wezterm.font 'Fira Code',
font_rules = {
-- Select a fancy italic font for italic text
{
italic = true,
font = wezterm.font('Operator Mono', { weight = 325, style = "Italic"}),
},
},
keys = {
{
key = '|', mods = 'CTRL|SHIFT',
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
},
{
key = 'Enter', mods = 'CTRL|SHIFT',
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' },
},
{
key = 'B', mods = 'CTRL',
action = wezterm.action.EmitEvent 'toggle-opacity',
},
{
key = 'P', mods = 'CTRL|SHIFT',
action = wezterm.action.EmitEvent 'toggle-theme',
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment