local wezterm = require 'wezterm'
local config = wezterm.config_builder()
config.color_scheme = 'Google Dark (Gogh)'
config.font_size = 11
config.font = wezterm.font_with_fallback {
'JetBrains Mono',
'Noto Color Emoji',
}
config.line_height = 1.2
config.cell_width = 1.0
config.initial_cols = 120
config.initial_rows = 32
config.window_background_opacity = 0.93
config.window_decorations = 'INTEGRATED_BUTTONS|RESIZE'
config.window_padding = {
left = 5,
right = 5,
top = 5,
bottom = 0,
}
config.window_close_confirmation = 'NeverPrompt'
config.front_end = 'OpenGL'
config.max_fps = 60
config.animation_fps = 60
config.default_cursor_style = 'BlinkingBlock'
config.cursor_blink_rate = 500
config.cursor_blink_ease_in = 'Constant'
config.cursor_blink_ease_out = 'Constant'
config.hide_mouse_cursor_when_typing = true
config.scrollback_lines = 10000
config.enable_scroll_bar = true
config.default_prog = { 'wsl.exe', '-d', 'openEuler-24.03', '--cd', '~' }
config.launch_menu = {
{
label = 'WSL openEuler-24.03',
args = { 'wsl.exe', '-d', 'openEuler-24.03', '--cd', '~' },
},
{
label = 'WSL openEuler (指定目录)',
args = { 'wsl.exe', '-d', 'openEuler-24.03' },
cwd = '\\\\wsl$\\openEuler-24.03\\home',
},
{
label = 'PowerShell',
args = { 'powershell.exe', '-NoLogo' },
},
{
label = 'Command Prompt',
args = { 'cmd.exe' },
},
{
label = 'Git Bash',
args = { 'C:\\Program Files\\Git\\bin\\bash.exe', '-i', '-l' },
},
}
config.enable_tab_bar = true
config.hide_tab_bar_if_only_one_tab = false
config.use_fancy_tab_bar = true
config.tab_bar_at_bottom = false
config.tab_max_width = 32
config.switch_to_last_active_tab_when_closing_tab = true
config.inactive_pane_hsb = {
saturation = 0.9,
brightness = 0.8,
}
config.pane_focus_follows_mouse = false
config.automatically_reload_config = true
config.audible_bell = 'Disabled'
config.check_for_updates = false
config.term = 'xterm-256color'
config.leader = {
key = 'Space',
mods = 'CTRL',
timeout_milliseconds = 1000,
}
config.keys = {
{
key = 'T',
mods = 'CTRL|SHIFT',
action = wezterm.action.SpawnCommandInNewTab {
args = { 'wsl.exe', '-d', 'openEuler-24.03', '--cd', '~' },
},
},
{
key = 'N',
mods = 'CTRL|SHIFT',
action = wezterm.action.SpawnCommandInNewWindow {
args = { 'wsl.exe', '-d', 'openEuler-24.03', '--cd', '~' },
},
},
{
key = 'L',
mods = 'CTRL|SHIFT',
action = wezterm.action.ShowLauncher,
},
{
key = 'P',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivateCommandPalette,
},
{
key = 'LeftArrow',
mods = 'ALT',
action = wezterm.action.ActivateTabRelative(-1),
},
{
key = 'RightArrow',
mods = 'ALT',
action = wezterm.action.ActivateTabRelative(1),
},
{
key = 'W',
mods = 'CTRL|SHIFT',
action = wezterm.action.CloseCurrentTab { confirm = true },
},
{
key = '|',
mods = 'LEADER|SHIFT',
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
},
{
key = '-',
mods = 'LEADER',
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' },
},
{
key = 'x',
mods = 'LEADER',
action = wezterm.action.CloseCurrentPane { confirm = true },
},
{
key = 'h',
mods = 'LEADER',
action = wezterm.action.ActivatePaneDirection 'Left',
},
{
key = 'j',
mods = 'LEADER',
action = wezterm.action.ActivatePaneDirection 'Down',
},
{
key = 'k',
mods = 'LEADER',
action = wezterm.action.ActivatePaneDirection 'Up',
},
{
key = 'l',
mods = 'LEADER',
action = wezterm.action.ActivatePaneDirection 'Right',
},
{
key = 'H',
mods = 'LEADER|SHIFT',
action = wezterm.action.AdjustPaneSize { 'Left', 5 },
},
{
key = 'J',
mods = 'LEADER|SHIFT',
action = wezterm.action.AdjustPaneSize { 'Down', 5 },
},
{
key = 'K',
mods = 'LEADER|SHIFT',
action = wezterm.action.AdjustPaneSize { 'Up', 5 },
},
{
key = 'L',
mods = 'LEADER|SHIFT',
action = wezterm.action.AdjustPaneSize { 'Right', 5 },
},
{
key = 'r',
mods = 'LEADER',
action = wezterm.action.RotatePanes 'Clockwise',
},
{
key = 'q',
mods = 'LEADER',
action = wezterm.action.PaneSelect,
},
{
key = 'R',
mods = 'LEADER|SHIFT',
action = wezterm.action.ReloadConfiguration,
},
}
config.mouse_bindings = {
{
event = { Down = { streak = 1, button = 'Right' } },
mods = 'NONE',
action = wezterm.action.PasteFrom 'Clipboard',
},
{
event = { Up = { streak = 1, button = 'Left' } },
mods = 'CTRL',
action = wezterm.action.OpenLinkAtMouseCursor,
},
}
return config