Skip to content

Instantly share code, notes, and snippets.

@luluco250
Last active December 6, 2021 13:08
Show Gist options
  • Save luluco250/0a28fc20325498b54cc67943d8dfaf8b to your computer and use it in GitHub Desktop.
Save luluco250/0a28fc20325498b54cc67943d8dfaf8b to your computer and use it in GitHub Desktop.
WezTerm config
local wt = require("wezterm");
local TabBackground = "#000"
local TabForeground = "#aaa"
local TabForegroundActive = "#fff"
function string.split(str, sep)
local t = {}
for s in string.gmatch(str, "([^"..sep.."]+)") do
table.insert(t, s)
end
return t
end
function reduce_title(title)
title = title:gsub("\\", "/")
title = title:split("/")
return title[#title]
end
wt.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
return reduce_title(tab.active_pane.title)
end)
wt.on("format-window-title", function(tab, pane, tabs, panes, config)
return reduce_title(tab.active_pane.title)
end)
return {
color_scheme = "Builtin Tango Dark",
colors = {
tab_bar = {
background = TabBackground,
active_tab = {
bg_color = TabBackground,
fg_color = TabForegroundActive,
intensity = "Bold",
},
inactive_tab = {
bg_color = TabBackground,
fg_color = TabForeground,
intensity = "Normal",
},
inactive_tab_hover = {
bg_color = TabBackground,
fg_color = TabForegroundActive,
intensity = "Normal",
},
new_tab = {
bg_color = TabBackground,
fg_color = TabForeground,
},
new_tab_hover = {
bg_color = TabBackground,
fg_color = TabForegroundActive,
},
},
},
initial_cols = 100,
initial_rows = 30,
font = wt.font("Cascadia Mono PL"),
font_size = 10,
default_cursor_style = "BlinkingBar",
cursor_blink_rate = 500,
hide_tab_bar_if_only_one_tab = true,
window_background_opacity = 0.85,
default_prog = {"C:/Program Files/PowerShell/7/pwsh.exe", "-NoLogo"},
alternate_buffer_wheel_scroll_speed = 1,
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
},
keys = {
{
key = "t",
mods = "CTRL",
action = wt.action{
SpawnTab = "DefaultDomain",
},
},
{
key = "w",
mods = "CTRL",
action = wt.action{
CloseCurrentTab = {
confirm = false,
},
},
},
{
key = "Tab",
mods = "CTRL",
action = wt.action{
ActivateTabRelative = 1,
},
},
{
key = "Tab",
mods = "CTRL|SHIFT",
action = wt.action{
ActivateTabRelative = -1,
},
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment