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
155 lines
3.4 KiB
Cheetah
local wezterm = require 'wezterm'
|
|
local act = wezterm.action
|
|
local config = wezterm.config_builder()
|
|
|
|
config.enable_scroll_bar = true
|
|
config.scrollback_lines = 12000
|
|
config.font = wezterm.font_with_fallback {
|
|
'Fira Code',
|
|
'FiraCode NF',
|
|
'FiraMono',
|
|
'Jetbrains Mono',
|
|
'Broot Icons Visual Studio Code',
|
|
}
|
|
config.font_size = {{cfg.wezterm.font_size}}
|
|
config.color_scheme = 'Dracula'
|
|
config.window_background_gradient = {
|
|
orientation = 'Vertical',
|
|
colors = {
|
|
'#1f142c',
|
|
'#191023',
|
|
},
|
|
}
|
|
|
|
config.inactive_pane_hsb = {
|
|
saturation = 0.9,
|
|
brightness = 0.65,
|
|
}
|
|
config.window_frame = {
|
|
active_titlebar_bg = '#090909',
|
|
-- inactive_titlebar_bg = '#1A002A',
|
|
}
|
|
|
|
|
|
|
|
config.colors = {
|
|
tab_bar = {
|
|
background = '#3A2A4D',
|
|
|
|
new_tab = {
|
|
bg_color = '#3A2A4D',
|
|
fg_color = '#ffffff',
|
|
},
|
|
new_tab_hover = {
|
|
bg_color = '#2B1C3D',
|
|
fg_color = '#ffffff',
|
|
italic = false,
|
|
},
|
|
},
|
|
}
|
|
|
|
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.." "
|
|
|
|
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)
|
|
-- keybinds, mostly inspired by konsole
|
|
config.keys = {
|
|
{
|
|
key = 't',
|
|
mods = 'CTRL|SHIFT',
|
|
action = act.SpawnTab 'CurrentPaneDomain',
|
|
},
|
|
{
|
|
key = 'w',
|
|
mods = 'SHIFT | 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)
|
|
},
|
|
{
|
|
key = 'h',
|
|
mods = 'SHIFT | ALT',
|
|
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
|