dotfiles/.config/wezterm/wezterm.lua
Claude 84fbb30d82
chore: drop macOS/Windows support and offline nvim tooling
- Remove macOS/Windows clipboard branches, homebrew fzf path from .vimrc
- Remove is_macos/is_windows logic from wezterm.lua
- Drop scripts/nvim-offline-* and NVIM_OFFLINE plumbing from nvim config
- Clean macOS section from .gitignore; simplify .gitattributes to LF-only
- Trim README of offline-bundle section
2026-06-07 16:50:33 +00:00

164 lines
4.6 KiB
Lua

local wezterm = require("wezterm")
local config = {}
if wezterm.config_builder then
config = wezterm.config_builder()
end
local function env_number(name, fallback)
local raw = os.getenv(name)
local parsed = raw and tonumber(raw) or nil
if parsed == nil then
return fallback
end
return parsed
end
-- Basic settings
config.automatically_reload_config = true
config.window_close_confirmation = "NeverPrompt"
config.adjust_window_size_when_changing_font_size = false
config.window_decorations = "RESIZE"
config.check_for_updates = false
config.use_fancy_tab_bar = false
config.tab_bar_at_bottom = false
config.enable_tab_bar = false
-- Font configuration
config.font_size = env_number("WEZTERM_FONT_SIZE", 16)
config.font = wezterm.font("JetBrains Mono", { weight = "Regular" })
config.bold_brightens_ansi_colors = true
config.force_reverse_video_cursor = false
local function resolve_theme_name()
local value = (os.getenv("WEZTERM_THEME") or "dragon"):lower()
local aliases = {
wave = "wave",
dragon = "dragon",
["kanagawa-wave"] = "wave",
["kanagawa-dragon"] = "dragon",
}
return aliases[value] or "dragon"
end
local themes = {
wave = {
foreground = "#dcd7ba",
background = "#1f1f28",
cursor_bg = "#c8c093",
cursor_fg = "#c8c093",
cursor_border = "#c8c093",
selection_fg = "#c8c093",
selection_bg = "#2d4f67",
scrollbar_thumb = "#16161d",
split = "#54546d",
ansi = {
"#090618",
"#c34043",
"#76946a",
"#c0a36e",
"#7e9cd8",
"#957fb8",
"#6a9589",
"#c8c093",
},
brights = {
"#727169",
"#e82424",
"#98bb6c",
"#e6c384",
"#7fb4ca",
"#938aa9",
"#7aa89f",
"#dcd7ba",
},
indexed = {
[16] = "#ffa066",
[17] = "#ff5d62",
},
},
dragon = {
foreground = "#c5c9c5",
background = "#181616",
cursor_bg = "#c5c9c5",
cursor_fg = "#181616",
cursor_border = "#c5c9c5",
selection_fg = "#c5c9c5",
selection_bg = "#2d4f67",
scrollbar_thumb = "#12120f",
split = "#625e5a",
ansi = {
"#0d0c0c",
"#c4746e",
"#87a987",
"#c4b28a",
"#8ba4b0",
"#a292a3",
"#8ea4a2",
"#c5c9c5",
},
brights = {
"#727169",
"#e46876",
"#8a9a7b",
"#c0a36e",
"#7fb4ca",
"#938aa9",
"#7aa89f",
"#c5c9c5",
},
indexed = {
[16] = "#b6927b",
[17] = "#b98d7b",
},
},
}
config.colors = themes[resolve_theme_name()] or themes.dragon
-- Window padding
config.window_padding = {
left = 8,
right = 8,
top = 8,
bottom = 8,
}
-- Window transparency
config.window_background_opacity = env_number("WEZTERM_WINDOW_OPACITY", 0.80)
-- Keep text cells opaque by default; transparent text backgrounds can show
-- grid/dot artifacts on some GPU/compositor combinations.
config.text_background_opacity = env_number("WEZTERM_TEXT_OPACITY", 1.0)
-- Performance
config.scrollback_lines = 10000
config.enable_scroll_bar = false
-- Cursor
config.default_cursor_style = "BlinkingBar"
config.cursor_blink_rate = 500
config.cursor_blink_ease_in = "Constant"
config.cursor_blink_ease_out = "Constant"
-- Key bindings
config.keys = {
{ key = "Enter", mods = "CTRL", action = wezterm.action({ SendString = "\x1b[13;5u" }) },
{ key = "Enter", mods = "SHIFT", action = wezterm.action({ SendString = "\x1b[13;2u" }) },
-- Navigate splits
{ key = "h", mods = "CTRL|SHIFT", action = wezterm.action.ActivatePaneDirection("Left") },
{ key = "l", mods = "CTRL|SHIFT", action = wezterm.action.ActivatePaneDirection("Right") },
{ key = "k", mods = "CTRL|SHIFT", action = wezterm.action.ActivatePaneDirection("Up") },
{ key = "j", mods = "CTRL|SHIFT", action = wezterm.action.ActivatePaneDirection("Down") },
-- Split panes
{ key = "|", mods = "CTRL|SHIFT", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
{ key = "_", mods = "CTRL|SHIFT", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) },
-- Close pane
{ key = "w", mods = "CTRL|SHIFT", action = wezterm.action.CloseCurrentPane({ confirm = false }) },
-- Zoom pane
{ key = "z", mods = "CTRL|SHIFT", action = wezterm.action.TogglePaneZoomState },
{ key = "f", mods = "SHIFT|CTRL", action = wezterm.action.ToggleFullScreen },
}
-- Hyperlink rules
config.hyperlink_rules = {
{ regex = "\\((\\w+://\\S+)\\)", format = "$1", highlight = 1 },
{ regex = "\\[(\\w+://\\S+)\\]", format = "$1", highlight = 1 },
{ regex = "\\{(\\w+://\\S+)\\}", format = "$1", highlight = 1 },
{ regex = "<(\\w+://\\S+)>", format = "$1", highlight = 1 },
{ regex = "[^(]\\b(\\w+://\\S+[)/a-zA-Z0.9-]+)", format = "$1", highlight = 1 },
{ regex = "\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b", format = "mailto:$0" },
}
-- Window size
config.initial_rows = 34
config.initial_cols = 135
return config