Skip to content

Instantly share code, notes, and snippets.

@ritchielrez
Last active November 4, 2024 13:08
Show Gist options
  • Save ritchielrez/97ed50bf7035e2917b28d0db421b6869 to your computer and use it in GitHub Desktop.
Save ritchielrez/97ed50bf7035e2917b28d0db421b6869 to your computer and use it in GitHub Desktop.
local wezterm = require("wezterm")
local config = wezterm.config_builder()
local act = wezterm.action
config.default_prog = { "bash" }
config.color_scheme = "Catppuccin Mocha (Gogh)"
config.window_decorations = "RESIZE"
config.window_close_confirmation = "NeverPrompt"
config.window_background_opacity = 0.8
config.win32_system_backdrop = "Acrylic"
config.use_fancy_tab_bar = false
config.tab_bar_at_bottom = true
-- Keymaps
config.leader = { key = "a", mods = "CTRL", timeout_milliseconds = 500 }
config.keys = {
{ key = "c", mods = "LEADER", action = act.ActivateCopyMode },
{ key = "phys:Space", mods = "LEADER", action = act.ActivateCommandPalette },
-- Pane management
{ mods = "LEADER", key = "v", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
{ mods = "LEADER", key = "s", action = act.SplitVertical({ domain = "CurrentPaneDomain" }) },
{ mods = "LEADER", key = "h", action = act.ActivatePaneDirection("Left") },
{ mods = "LEADER", key = "j", action = act.ActivatePaneDirection("Down") },
{ mods = "LEADER", key = "k", action = act.ActivatePaneDirection("Up") },
{ mods = "LEADER", key = "l", action = act.ActivatePaneDirection("Right") },
{ mods = "LEADER", key = "w", action = act.CloseCurrentPane({ confirm = false }) },
{ mods = "LEADER", key = "t", action = act.SpawnTab("CurrentPaneDomain") },
{ mods = "LEADER", key = "b", action = act.ActivateTabRelative(-1) },
{ mods = "LEADER", key = "n", action = act.ActivateTabRelative(1) },
{ mods = "LEADER", key = "r", action = act.ActivateKeyTable({ name = "resize_pane", one_shot = false }) },
}
config.key_tables = {
resize_pane = {
{ key = "h", action = act.AdjustPaneSize({ "Left", 1 }) },
{ key = "j", action = act.AdjustPaneSize({ "Down", 1 }) },
{ key = "k", action = act.AdjustPaneSize({ "Up", 1 }) },
{ key = "l", action = act.AdjustPaneSize({ "Right", 1 }) },
{ key = "Escape", action = "PopKeyTable" },
{ key = "Enter", action = "PopKeyTable" },
},
}
wezterm.on("update-right-status", function(win, pane)
-- "Wed Mar 3 08:14"
local date = wezterm.strftime("%a %b %-d %H:%M ")
win:set_right_status(wezterm.format({
{ Text = date },
}))
end)
-- and finally, return the configuration to wezterm
return config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment