Skip to content

Instantly share code, notes, and snippets.

@RajChowdhury240
Created September 4, 2025 10:44
Show Gist options
  • Save RajChowdhury240/b88c4bb0b90767f8e7bef054b5cf8fdf to your computer and use it in GitHub Desktop.
Save RajChowdhury240/b88c4bb0b90767f8e7bef054b5cf8fdf to your computer and use it in GitHub Desktop.
local wezterm = require("wezterm")
local mappings = require("modules.mappings")
-- Show which key table is active in the status area
wezterm.on("update-right-status", function(window, pane)
local name = window:active_key_table()
if name then
name = "TABLE: " .. name
end
window:set_right_status(name or "")
end)
return {
default_cursor_style = "BlinkingBlock",
color_scheme = "Poimandres",
colors = {
cursor_bg = "#A6ACCD",
cursor_border = "#A6ACCD",
cursor_fg = "#1B1E28",
},
-- font
font = wezterm.font("Liga SFMono Nerd Font", { weight = "Medium" }),
font_size = 15,
window_background_opacity = 0.80,
-- tab bar
use_fancy_tab_bar = false,
tab_bar_at_bottom = true,
hide_tab_bar_if_only_one_tab = true,
tab_max_width = 999999,
window_decorations = "RESIZE",
send_composed_key_when_left_alt_is_pressed = false,
send_composed_key_when_right_alt_is_pressed = true,
-- key bindings
leader = mappings.leader,
keys = mappings.keys,
key_tables = mappings.key_tables,
}
@RajChowdhury240
Copy link
Author

mappings.lua

local wezterm = require("wezterm")
local act = wezterm.action

return {
	leader = { key = "Space", mods = "SHIFT" },

	keys = {
		{
			key = "w",
			mods = "CMD",
			action = act.CloseCurrentPane({ confirm = true }),
		},

		-- activate resize mode
		{
			key = "r",
			mods = "LEADER",
			action = act.ActivateKeyTable({
				name = "resize_pane",
				one_shot = false,
			}),
		},

		-- focus panes
		{
			key = "k",
			mods = "LEADER",
			action = act.ActivatePaneDirection("Left"),
		},
		{
			key = "i",
			mods = "LEADER",
			action = act.ActivatePaneDirection("Right"),
		},
		{
			key = "e",
			mods = "LEADER",
			action = act.ActivatePaneDirection("Up"),
		},
		{
			key = "n",
			mods = "LEADER",
			action = act.ActivatePaneDirection("Down"),
		},

		-- add new panes
		{
			key = "v",
			mods = "LEADER",
			action = act.SplitVertical({ domain = "CurrentPaneDomain" }),
		},
		{
			key = "h",
			mods = "LEADER",
			action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }),
		},
	},

	key_tables = {
		resize_pane = {
			{ key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 5 }) },
			{ key = "k", action = act.AdjustPaneSize({ "Left", 5 }) },

			{ key = "RightArrow", action = act.AdjustPaneSize({ "Right", 5 }) },
			{ key = "i", action = act.AdjustPaneSize({ "Right", 5 }) },

			{ key = "UpArrow", action = act.AdjustPaneSize({ "Up", 2 }) },
			{ key = "e", action = act.AdjustPaneSize({ "Up", 2 }) },

			{ key = "DownArrow", action = act.AdjustPaneSize({ "Down", 2 }) },
			{ key = "n", action = act.AdjustPaneSize({ "Down", 2 }) },

			{ key = "Escape", action = "PopKeyTable" },
		},
	},
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment