Created
January 10, 2025 04:40
-
-
Save vladkens/f2ae7c374c1752c4b1581c5e7dffa900 to your computer and use it in GitHub Desktop.
WezTerm config for iTerm users https://vnotes.pages.dev/from-iterm-to-wezterm/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local wezterm = require "wezterm" | |
local config = wezterm.config_builder() | |
local action = wezterm.action | |
config.set_environment_variables = { | |
PATH = '/opt/homebrew/bin:' .. os.getenv('PATH') | |
} | |
local function scheme_for_appearance(appearance) | |
if appearance:find "Dark" then | |
return "Catppuccin Macchiato" | |
else | |
return "Catppuccin Latte" | |
end | |
end | |
config.font = wezterm.font { | |
family = 'JetBrains Mono', | |
weight = 'Medium', | |
harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' }, | |
} | |
config.font_size = 14.0 | |
config.line_height = 1.0 | |
config.bold_brightens_ansi_colors = true | |
config.color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()) | |
config.window_decorations = 'RESIZE|INTEGRATED_BUTTONS' | |
config.window_padding = { left = '0.5cell', right = '0.5cell', top = '0.5cell', bottom = '0.5cell' } | |
config.window_background_opacity = 0.96 | |
config.macos_window_background_blur = 20 | |
config.default_cursor_style = 'BlinkingBar' | |
-- https://github.com/wez/wezterm/issues/3299#issuecomment-2145712082 | |
wezterm.on("gui-startup", function(cmd) | |
local active = wezterm.gui.screens().active | |
local tab, pane, window = wezterm.mux.spawn_window(cmd or {}) | |
window:gui_window():set_position(active.x, active.y) | |
window:gui_window():set_inner_size(active.width, active.height) | |
end) | |
config.keys = { | |
{ key = 'd', mods = 'CMD|SHIFT', action = action.SplitVertical { domain = 'CurrentPaneDomain' } }, | |
{ key = 'd', mods = 'CMD', action = action.SplitHorizontal { domain = 'CurrentPaneDomain' } }, | |
{ key = 'k', mods = 'CMD', action = action.ClearScrollback 'ScrollbackAndViewport' }, | |
{ key = 'w', mods = 'CMD', action = action.CloseCurrentPane { confirm = false } }, | |
{ key = 'w', mods = 'CMD|SHIFT', action = action.CloseCurrentTab { confirm = false } }, | |
{ key = 'LeftArrow', mods = 'CMD', action = action.SendKey { key = 'Home' } }, | |
{ key = 'RightArrow', mods = 'CMD', action = action.SendKey { key = 'End' } }, | |
{ key = 'p', mods = 'CMD|SHIFT', action = action.ActivateCommandPalette }, | |
{ key = ',', mods = 'CMD', action = action.SpawnCommandInNewTab { cwd = wezterm.home_dir, args = { 'zed', wezterm.config_file } } }, | |
} | |
return config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment