From 6a39bb0441f1df5923809c018ad1843ccf77630d Mon Sep 17 00:00:00 2001 From: Tomas Mirchev Date: Thu, 17 Jul 2025 08:47:23 +0300 Subject: [PATCH] wezterm --- config/shared/wezterm | 70 -------------------- config/shared/wezterm/wezterm.lua | 106 ++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 70 deletions(-) delete mode 100644 config/shared/wezterm create mode 100644 config/shared/wezterm/wezterm.lua diff --git a/config/shared/wezterm b/config/shared/wezterm deleted file mode 100644 index 4edfc82..0000000 --- a/config/shared/wezterm +++ /dev/null @@ -1,70 +0,0 @@ -local wezterm = require('wezterm') - -local config = wezterm.config_builder() - -config.term="xterm-256color" -config.color_scheme = "Catppuccin Frappe" -config.font = wezterm.font('FiraCode Nerd Font') --- config.window_decorations = "INTEGRATED_BUTTONS | RESIZE" -config.font_size = 14.0 -config.use_resize_increments = true -config.window_padding = { - left = 4, - right = 4, - top = 4, - bottom = 0, -} -config.mouse_bindings = { - { - event = { Drag = { streak = 1, button = 'Left' } }, - mods = 'CMD', - action = wezterm.action.StartWindowDrag, - }, - { - event = { Drag = { streak = 1, button = 'Left' } }, - mods = 'CTRL|SHIFT', - action = wezterm.action.StartWindowDrag, - }, -} -local act = wezterm.action -config.keys = { - { - key = 'w', - mods = 'CMD', - action = wezterm.action.CloseCurrentTab { confirm = false } - }, - { - key = 'LeftArrow', - mods = 'CMD', - action = wezterm.action { SendString = '\x1b0H' } - }, - { - key = 'RightArrow', - mods = 'CMD', - action = wezterm.action { SendString = '\x1b0F' } - }, - { - key = 'LeftArrow', - mods = 'OPT', - action = act.SendKey { key = 'b', mods = 'ALT' } - }, - { - key = 'RightArrow', - mods = 'OPT', - action = act.SendKey { key = 'f', mods = 'ALT' } - } - ---- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word - --{ - -- key="LeftArrow", - -- mods="OPT", - -- action=wezterm.action{SendString="\x1bb"} - --}, - ---- Make Option-Right equivalent to Alt-f; forward-word - --{ - -- key="RightArrow", - -- mods="OPT", - -- action=wezterm.action{SendString="\x1bf"} - --} -} - -return config diff --git a/config/shared/wezterm/wezterm.lua b/config/shared/wezterm/wezterm.lua new file mode 100644 index 0000000..c0ced37 --- /dev/null +++ b/config/shared/wezterm/wezterm.lua @@ -0,0 +1,106 @@ +-- wezterm.lua configuration file +local wezterm = require 'wezterm' + +-- This table will hold the configuration. +local config = {} + +-- In newer versions of wezterm, use the config_builder which will +-- help provide clearer error messages +if wezterm.config_builder then + config = wezterm.config_builder() +end + +-- Environment variables +config.term="xterm-256color" +config.set_environment_variables = { + TERM = "xterm-256color", +} + +-- Font configuration +config.font = wezterm.font('JetBrainsMono Nerd Font', {weight = 'Bold'}) +-- config.freetype_render_target = "HorizontalLcd" +-- config.freetype_load_flags = 'NO_HINTING' +-- config.freetype_load_target = "Light" +config.bold_brightens_ansi_colors = false + +local act = wezterm.action + +config.font_size = 14 +-- Alacritty's offset translates to cell_width and line_height in wezterm +-- Since your offset is 0, we're keeping default values + +-- Window configuration +config.window_padding = { + left = 4, + right = 4, + top = 0, + bottom = 0, +} +-- config.window_decorations = "RESIZE|TITLE|MACOS_USE_BACKGROUND_COLOR_AS_TITLEBAR_COLOR|MACOS_FORCE_ENABLE_SHADOW" -- Similar to decorations_theme_variant = "Dark" +config.window_decorations = "TITLE|RESIZE" +config.use_resize_increments = false +-- Wezterm doesn't have direct equivalents for dynamic_padding and resize_increments +-- but we can set related options + +-- Keyboard bindings +config.keys = { + {key="LeftArrow", mods="SUPER|SHIFT", action=wezterm.action{MoveTabRelative=-1}}, + {key="RightArrow", mods="SUPER|SHIFT", action=wezterm.action{MoveTabRelative=1}}, + + -- Create new window + { + key = 'n', + mods = 'CMD', + action = wezterm.action.SpawnWindow, + }, + -- Jump back one word (Alt+Left) + { + key = 'LeftArrow', + mods = 'ALT', + action = wezterm.action.SendString('\x1bb'), + }, + -- Jump forward one word (Alt+Right) + { + key = 'RightArrow', + mods = 'ALT', + action = wezterm.action.SendString('\x1bf'), + }, + -- Move to start of line (Cmd+Left) + { + key = 'LeftArrow', + mods = 'CMD', + action = wezterm.action.SendString('\x01'), + }, + -- Move to end of line (Cmd+Right) + { + key = 'RightArrow', + mods = 'CMD', + action = wezterm.action.SendString('\x05'), + }, + -- Delete backwards word (Alt+Backspace) + { + key = 'Backspace', + mods = 'ALT', + action = wezterm.action.SendString('\x1b\x7f'), + }, + -- Delete backwards line (Cmd+Backspace) + { + key = 'Backspace', + mods = 'CMD', + action = wezterm.action.SendString('\x15'), + }, + -- Delete forwards word (Alt+Delete) + { + key = 'Delete', + mods = 'ALT', + action = wezterm.action.SendString('\x1bd'), + }, + -- Delete forwards line (Cmd+Delete) + { + key = 'Delete', + mods = 'CMD', + action = wezterm.action.SendString('\x0b'), + }, +} + +return config