2022-12-03 14:42:03 +01:00
|
|
|
local wezterm = require("wezterm")
|
2023-03-07 10:42:16 +01:00
|
|
|
local mux = wezterm.mux
|
|
|
|
local act = wezterm.action
|
2021-04-01 16:02:19 +02:00
|
|
|
|
2023-04-27 15:40:49 +02:00
|
|
|
local dev_host = "dln-dev"
|
|
|
|
local spawn_dev_nvim = { "ssh", dev_host, "nvim", "--listen", os.getenv("XDG_RUNTIME_DIR") .. "/nvim-persistent.sock" }
|
|
|
|
|
2023-03-07 16:53:50 +01:00
|
|
|
local function font_with_fallback(name, params)
|
2023-03-07 10:42:16 +01:00
|
|
|
local names = { name, "Noto Color Emoji" }
|
2022-12-03 14:42:03 +01:00
|
|
|
return wezterm.font_with_fallback(names, params)
|
2021-04-01 16:02:19 +02:00
|
|
|
end
|
|
|
|
|
2023-03-07 16:53:50 +01:00
|
|
|
wezterm.on("gui-startup", function(cmd)
|
2023-03-12 19:44:30 +01:00
|
|
|
local args = {}
|
|
|
|
if cmd then
|
|
|
|
args = cmd.args
|
|
|
|
end
|
2023-03-08 20:58:53 +01:00
|
|
|
|
2023-04-27 15:40:49 +02:00
|
|
|
local tab, pane, window = mux.spawn_window({
|
2023-03-12 19:44:30 +01:00
|
|
|
workspace = "local",
|
2023-04-27 15:40:49 +02:00
|
|
|
args = { "nvim", "--listen", os.getenv("XDG_RUNTIME_DIR") .. "/nvim-persistent.sock" },
|
2023-03-08 20:58:53 +01:00
|
|
|
})
|
2023-04-27 15:40:49 +02:00
|
|
|
tab:set_title("nvim")
|
|
|
|
|
|
|
|
for _ = 1, 9 do
|
2023-03-12 19:44:30 +01:00
|
|
|
window:spawn_tab({})
|
|
|
|
end
|
2023-04-27 15:40:49 +02:00
|
|
|
window:gui_window():perform_action(act.ActivateTab(1), pane)
|
2023-03-08 20:58:53 +01:00
|
|
|
|
2023-04-27 15:40:49 +02:00
|
|
|
local tab, pane, window = mux.spawn_window({
|
|
|
|
workspace = dev_host,
|
|
|
|
args = spawn_dev_nvim,
|
2023-03-08 20:58:53 +01:00
|
|
|
})
|
2023-04-27 15:40:49 +02:00
|
|
|
tab:set_title("nvim")
|
|
|
|
|
|
|
|
for _ = 1, 9 do
|
|
|
|
window:spawn_tab({ args = { "ssh", dev_host } })
|
2023-03-12 19:44:30 +01:00
|
|
|
end
|
2023-01-27 09:46:22 +01:00
|
|
|
|
2023-04-27 15:40:49 +02:00
|
|
|
mux.set_active_workspace("local")
|
|
|
|
end)
|
2021-04-03 10:19:45 +02:00
|
|
|
|
2023-03-08 22:59:58 +01:00
|
|
|
local function activate_nvim(window, pane)
|
|
|
|
for _, t in ipairs(window:mux_window():tabs_with_info()) do
|
|
|
|
for _, p in ipairs(t.tab:panes()) do
|
2023-04-27 15:40:49 +02:00
|
|
|
if p:get_title() == "nvim" or t.tab:get_title() == "nvim" then
|
2023-03-08 22:59:58 +01:00
|
|
|
window:perform_action(
|
|
|
|
act.Multiple({
|
|
|
|
act.ActivateTab(t.index),
|
|
|
|
act.MoveTab(0),
|
|
|
|
}),
|
|
|
|
pane
|
|
|
|
)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2023-04-27 15:40:49 +02:00
|
|
|
|
|
|
|
local nvim = { "nvim", "--listen", os.getenv("XDG_RUNTIME_DIR") .. "/nvim-persistent.sock" }
|
|
|
|
if window:mux_window():get_workspace() == dev_host then
|
|
|
|
nvim = spawn_dev_nvim
|
|
|
|
end
|
|
|
|
|
|
|
|
local tab, pane, _ = window:mux_window():spawn_tab({ args = nvim })
|
|
|
|
window:perform_action(act.MoveTab(0), pane)
|
|
|
|
tab:set_title("nvim")
|
2023-03-08 22:59:58 +01:00
|
|
|
end
|
|
|
|
|
2023-03-07 22:56:45 +01:00
|
|
|
wezterm.on("user-var-changed", function(window, pane, name, value)
|
|
|
|
if name == "nvim_activate" then
|
2023-03-08 22:59:58 +01:00
|
|
|
activate_nvim(window, pane)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
2023-04-27 15:40:49 +02:00
|
|
|
wezterm.on("activate-nvim", activate_nvim)
|
2023-03-07 22:56:45 +01:00
|
|
|
|
2023-04-27 15:40:49 +02:00
|
|
|
wezterm.add_to_config_reload_watch_list(os.getenv("HOME") .. "/.config/shelman-theme/current/wezterm")
|
2023-03-09 18:11:46 +01:00
|
|
|
|
2021-04-01 16:02:19 +02:00
|
|
|
return {
|
2023-03-09 18:11:46 +01:00
|
|
|
color_scheme = "Shelman Theme",
|
|
|
|
color_scheme_dirs = {
|
2023-04-27 15:40:49 +02:00
|
|
|
os.getenv("HOME") .. "/.config/shelman-theme/current/wezterm",
|
2023-03-09 18:11:46 +01:00
|
|
|
},
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS09", { weight = "Regular" }),
|
2022-12-03 14:42:03 +01:00
|
|
|
font_rules = {
|
|
|
|
{
|
|
|
|
italic = false,
|
|
|
|
intensity = "Half",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS09", { weight = "Thin" }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
italic = true,
|
|
|
|
intensity = "Normal",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman Curly Slab", { weight = "Light", italic = true }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
italic = true,
|
|
|
|
intensity = "Bold",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS15", { weight = "ExtraLight", italic = true }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
intensity = "Bold",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS09", { weight = "DemiBold" }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
},
|
2023-04-17 12:57:34 +02:00
|
|
|
front_end = "WebGpu",
|
2023-04-27 15:40:49 +02:00
|
|
|
webgpu_power_preference = "HighPerformance",
|
2022-12-03 14:42:03 +01:00
|
|
|
warn_about_missing_glyphs = false,
|
|
|
|
bold_brightens_ansi_colors = false,
|
2022-12-06 17:19:07 +01:00
|
|
|
allow_square_glyphs_to_overflow_width = "Always",
|
2023-03-07 10:42:16 +01:00
|
|
|
font_size = 13.5,
|
2023-03-24 09:19:10 +01:00
|
|
|
command_palette_font_size = 13.5,
|
2022-12-06 17:19:07 +01:00
|
|
|
line_height = 1.0,
|
2023-03-07 10:42:16 +01:00
|
|
|
cell_width = 0.95,
|
2023-03-09 18:11:07 +01:00
|
|
|
initial_cols = 132,
|
|
|
|
initial_rows = 45,
|
2023-03-07 10:42:16 +01:00
|
|
|
use_resize_increments = true,
|
|
|
|
window_background_opacity = 1.0,
|
|
|
|
colors = {
|
|
|
|
tab_bar = {
|
|
|
|
active_tab = {
|
|
|
|
fg_color = "#e0e0e0",
|
|
|
|
bg_color = "#374f66",
|
|
|
|
},
|
|
|
|
},
|
2023-01-27 09:46:22 +01:00
|
|
|
},
|
2022-12-03 14:42:03 +01:00
|
|
|
default_cursor_style = "SteadyBlock",
|
|
|
|
cursor_thickness = "3px",
|
2023-04-17 12:57:02 +02:00
|
|
|
cursor_blink_rate = 0,
|
2022-12-03 14:42:03 +01:00
|
|
|
enable_wayland = true,
|
2023-04-17 12:57:02 +02:00
|
|
|
enable_tab_bar = false,
|
2022-12-03 14:42:03 +01:00
|
|
|
tab_bar_at_bottom = true,
|
2023-04-27 15:40:49 +02:00
|
|
|
use_fancy_tab_bar = false,
|
2022-12-03 14:42:03 +01:00
|
|
|
show_tab_index_in_tab_bar = true,
|
|
|
|
enable_scroll_bar = false,
|
|
|
|
scrollback_lines = 5000,
|
2023-03-09 18:11:07 +01:00
|
|
|
alternate_buffer_wheel_scroll_speed = 1,
|
2022-12-03 14:42:03 +01:00
|
|
|
check_for_updates = false,
|
|
|
|
status_update_interval = 100,
|
|
|
|
audible_bell = "Disabled",
|
|
|
|
term = "wezterm",
|
|
|
|
disable_default_key_bindings = true,
|
|
|
|
keys = {
|
2023-03-24 09:19:10 +01:00
|
|
|
{ key = "c", mods = "ALT|SHIFT", action = act.CopyTo("ClipboardAndPrimarySelection") },
|
2023-03-28 11:09:23 +02:00
|
|
|
{ key = "v", mods = "ALT|SHIFT", action = act.PasteFrom("Clipboard") },
|
2022-12-03 14:42:03 +01:00
|
|
|
{ key = "0", mods = "CTRL", action = "ResetFontSize" },
|
|
|
|
{ key = "-", mods = "CTRL", action = "DecreaseFontSize" },
|
|
|
|
{ key = "=", mods = "CTRL", action = "IncreaseFontSize" },
|
|
|
|
{ key = "Enter", mods = "ALT", action = "ToggleFullScreen" },
|
2023-03-07 10:42:16 +01:00
|
|
|
{ key = "r", mods = "ALT", action = act.ReloadConfiguration },
|
2023-04-27 15:40:49 +02:00
|
|
|
{ key = "L", mods = "CTRL", action = wezterm.action.ShowDebugOverlay },
|
2023-03-07 10:42:16 +01:00
|
|
|
-- mux
|
2023-04-27 15:40:49 +02:00
|
|
|
{ key = "1", mods = "ALT", action = act.EmitEvent("activate-nvim") },
|
|
|
|
{ key = "2", mods = "ALT", action = act.ActivateTab(1) },
|
|
|
|
{ key = "3", mods = "ALT", action = act.ActivateTab(2) },
|
|
|
|
{ key = "4", mods = "ALT", action = act.ActivateTab(3) },
|
|
|
|
{ key = "5", mods = "ALT", action = act.ActivateTab(4) },
|
|
|
|
{ key = "6", mods = "ALT", action = act.ActivateTab(5) },
|
|
|
|
{ key = "7", mods = "ALT", action = act.ActivateTab(6) },
|
|
|
|
{ key = "8", mods = "ALT", action = act.ActivateTab(7) },
|
|
|
|
{ key = "9", mods = "ALT", action = act.ActivateTab(8) },
|
|
|
|
{ key = "0", mods = "ALT", action = act.ActivateTab(9) },
|
2023-03-07 22:56:45 +01:00
|
|
|
{ key = "RightArrow", mods = "CTRL", action = act.ActivateTabRelative(1) },
|
|
|
|
{ key = "LeftArrow", mods = "CTRL", action = act.ActivateTabRelative(-1) },
|
2023-03-24 09:19:10 +01:00
|
|
|
{ key = "l", mods = "ALT", action = wezterm.action.ActivateCommandPalette },
|
2023-03-08 20:58:53 +01:00
|
|
|
{ key = "Backspace", mods = "ALT", action = act.SwitchWorkspaceRelative(1) },
|
2023-03-09 18:11:07 +01:00
|
|
|
{ key = "UpArrow", mods = "SHIFT", action = act.ScrollByLine(-1) },
|
|
|
|
{ key = "DownArrow", mods = "SHIFT", action = act.ScrollByLine(1) },
|
|
|
|
{ key = "PageUp", mods = "SHIFT", action = act.ScrollByPage(-0.5) },
|
|
|
|
{ key = "PageDown", mods = "SHIFT", action = act.ScrollByPage(0.5) },
|
|
|
|
},
|
|
|
|
mouse_bindings = {
|
|
|
|
{
|
|
|
|
event = { Down = { streak = 1, button = { WheelUp = 1 } } },
|
|
|
|
mods = "SHIFT",
|
|
|
|
action = act.ScrollByLine(-1),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
event = { Down = { streak = 1, button = { WheelDown = 1 } } },
|
|
|
|
mods = "SHIFT",
|
|
|
|
action = act.ScrollByLine(1),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
event = { Down = { streak = 1, button = { WheelUp = 1 } } },
|
|
|
|
action = act.ScrollByPage(-0.25),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
event = { Down = { streak = 1, button = { WheelDown = 1 } } },
|
|
|
|
action = act.ScrollByPage(0.25),
|
|
|
|
},
|
2023-03-07 10:42:16 +01:00
|
|
|
},
|
2021-04-01 16:02:19 +02:00
|
|
|
}
|