From 345c9373f66bdcc53ec484873c015c6c897c89bf Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 20 May 2026 23:40:35 +0800 Subject: [PATCH] feat: added wezterm config --- .wezterm.lua | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .wezterm.lua diff --git a/.wezterm.lua b/.wezterm.lua new file mode 100644 index 0000000..254c4a6 --- /dev/null +++ b/.wezterm.lua @@ -0,0 +1,80 @@ +local wezterm = require 'wezterm' + +local config = wezterm.config_builder() + +-- Add Homebrew paths to PATH (critical for finding tmuxai) +config.set_environment_variables = { + PATH = "/opt/homebrew/bin:/usr/local/bin:" .. (os.getenv("PATH") or "") +} + +-- Essential macOS performance tweaks +config.front_end = 'OpenGL' -- Better GPU acceleration on macOS +config.window_background_opacity = 0.5 +config.macos_window_background_blur = 5 -- Subtle transparency +config.use_fancy_tab_bar = false -- More performant simple tab bar + +-- Font rendering optimizations for Retina displays +config.font_size = 11.0 +config.color_scheme = 'DjangoSmooth' + +-- AI terminal assistant integration (for your OpenRouter setup) +config.keys = { + { + key = 'a', + mods = 'CMD|SHIFT', + action = wezterm.action({ + SpawnCommandInNewTab = { + args = {'tmuxai'}, + }, + }), + }, + -- Command + Left Arrow = Beginning of line + { + key = "LeftArrow", + mods = "SUPER", + action = wezterm.action({SendString="\x1bOH"}) + }, + -- Command + Right Arrow = End of line + { + key = "RightArrow", + mods = "SUPER", + action = wezterm.action({SendString="\x1bOF"}) + }, + -- Command + Up Arrow = Beginning of document + { + key = "UpArrow", + mods = "SUPER", + action = wezterm.action({SendString="\x1b[1;5A"}) + }, + -- Command + Down Arrow = End of document + { + key = "DownArrow", + mods = "SUPER", + action = wezterm.action({SendString="\x1b[1;5B"}) + }, + -- Option + Left Arrow = Move one word left + { + key = "LeftArrow", + mods = "ALT", + action = wezterm.action({SendString="\x1bb"}) + }, + -- Option + Right Arrow = Move one word right + { + key = "RightArrow", + mods = "ALT", + action = wezterm.action({SendString="\x1bf"}) + }, + -- Command + Delete = Delete to beginning of line + { + key = "Backspace", + mods = "SUPER", + action = wezterm.action({SendString="\x15"}) + } +} + +-- General quality-of-life improvements +config.hide_tab_bar_if_only_one_tab = true +config.adjust_window_size_when_changing_font_size = false +config.window_decorations = 'RESIZE' + +return config