You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
3.4 KiB
Cheetah

11 months ago
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
11 months ago
config.enable_scroll_bar = true
config.scrollback_lines = 12000
config.font = wezterm.font_with_fallback {
'Fira Code',
'FiraCode NF',
'FiraMono',
'Jetbrains Mono',
10 months ago
'Broot Icons Visual Studio Code',
11 months ago
}
config.font_size = {{cfg.wezterm.font_size}}
11 months ago
config.color_scheme = 'Dracula'
config.window_background_gradient = {
orientation = 'Vertical',
colors = {
9 months ago
'#1f142c',
'#191023',
11 months ago
},
}
config.inactive_pane_hsb = {
saturation = 0.9,
brightness = 0.65,
}
11 months ago
config.window_frame = {
active_titlebar_bg = '#090909',
-- inactive_titlebar_bg = '#1A002A',
11 months ago
}
11 months ago
config.colors = {
tab_bar = {
background = '#3A2A4D',
9 months ago
new_tab = {
bg_color = '#3A2A4D',
fg_color = '#ffffff',
},
new_tab_hover = {
bg_color = '#2B1C3D',
fg_color = '#ffffff',
italic = false,
},
},
11 months ago
}
config.window_padding = { left = 10, right = 10, top = 10, bottom = 10 }
config.use_fancy_tab_bar = false
config.tab_max_width = 32
local function tab_title(tab)
local title = tab.tab_title
-- if the tab title is explicitly set, take that
if title and #title > 0 then
return title
end
local panetitle = tab.active_pane.title
if panetitle and #panetitle > 0 then
return panetitle
end
-- Otherwise, use the default title.
return "Tab #" .. tab.tab_index + 1
end
wezterm.on("format-tab-title", function(tab, _, _, _, _, max_width)
local solid_left_arrow = ""
local solid_right_arrow = ""
local bg_color = "#3A2A4D"
local bg_active_color = "#2B1C3D"
local fg_color = "#FFFFFF"
local fg_active_color = "#FFFFFF"
-- Edge icon color
local edge_icon_bg = bg_color
local edge_icon_fg = bg_color
-- Inactive tab
local tab_bg_color = bg_active_color
local tab_fg_color = fg_color
if tab.is_active then
tab_bg_color = fg_active_color
tab_fg_color = bg_color
end
edge_icon_fg = tab_bg_color
local title = wezterm.truncate_right(tab_title(tab), max_width - 4)
title = " "..title.." "
11 months ago
return {
{ Background = { Color = edge_icon_bg } },
{ Foreground = { Color = edge_icon_fg } },
{ Text = solid_left_arrow },
{ Background = { Color = tab_bg_color } },
{ Foreground = { Color = tab_fg_color } },
{ Text = title },
{ Background = { Color = edge_icon_bg } },
{ Foreground = { Color = edge_icon_fg } },
{ Text = solid_right_arrow },
}
end)
11 months ago
-- keybinds, mostly inspired by konsole
config.keys = {
{
key = 't',
mods = 'CTRL|SHIFT',
action = act.SpawnTab 'CurrentPaneDomain',
},
{
key = 'w',
mods = 'CTRL',
action = act.CloseCurrentTab { confirm = true }
},
{
key = 'RightArrow',
mods = 'SHIFT',
action = act.ActivateTabRelative(1)
},
{
key = 'LeftArrow',
mods = 'SHIFT',
action = act.ActivateTabRelative(-1)
}, {
key = 'l',
mods = 'SHIFT | ALT',
action = act.ActivateTabRelative(1)
11 months ago
},
{
key = 'h',
mods = 'SHIFT | ALT',
11 months ago
action = act.ActivateTabRelative(-1)
},
{
key = 'n',
mods = 'CTRL',
action = act.SpawnWindow
},
}
{{#if flags.windows}}
-- Windows specific configuration
config.default_prog = { 'nu' }
{{/if}}
{{#if flags.unix}}
-- Linux specific configuration
{{/if}}
return config