-
-
Save fedesilva/b81c0388a45828c7c3451eace96223d4 to your computer and use it in GitHub Desktop.
WezTerm config with Ghostty-style keybindings and default theme (Turn WezTerm into Ghostty)
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 act = wezterm.action | |
| local config = wezterm.config_builder() | |
| -- Ghostty default color scheme with macOS selection highlight | |
| config.colors = { | |
| foreground = "#d8d8d8", | |
| background = "#282c34", | |
| cursor_bg = "#d8d8d8", | |
| cursor_fg = "#282c34", | |
| cursor_border = "#d8d8d8", | |
| -- macOS default selection highlight | |
| selection_bg = "#b4d7ff", | |
| selection_fg = "#000000", | |
| ansi = { | |
| "#1d2021", -- black | |
| "#cc241d", -- red | |
| "#98971a", -- green | |
| "#d79921", -- yellow | |
| "#458588", -- blue | |
| "#b16286", -- magenta | |
| "#689d6a", -- cyan | |
| "#a89984", -- white | |
| }, | |
| brights = { | |
| "#928374", -- bright black | |
| "#fb4934", -- bright red | |
| "#b8bb26", -- bright green | |
| "#fabd2f", -- bright yellow | |
| "#83a598", -- bright blue | |
| "#d3869b", -- bright magenta | |
| "#8ec07c", -- bright cyan | |
| "#ebdbb2", -- bright white | |
| }, | |
| } | |
| -- Hide tab bar when only one tab | |
| config.hide_tab_bar_if_only_one_tab = true | |
| -- Enable scroll bar | |
| config.enable_scroll_bar = true | |
| -- Font settings (matching Ghostty defaults) | |
| config.font_size = 13 | |
| config.line_height = 1.0 | |
| config.cell_width = 1.0 | |
| -- Hyperlinks: open with Cmd+click only | |
| config.hyperlink_rules = wezterm.default_hyperlink_rules() | |
| config.mouse_bindings = { | |
| -- Disable default click-to-open links (only Cmd+click should open) | |
| { | |
| event = { Up = { streak = 1, button = "Left" } }, | |
| mods = "NONE", | |
| action = act.CompleteSelection("ClipboardAndPrimarySelection"), | |
| }, | |
| -- Cmd+click to open hyperlinks | |
| { | |
| event = { Up = { streak = 1, button = "Left" } }, | |
| mods = "CMD", | |
| action = act.OpenLinkAtMouseCursor, | |
| }, | |
| } | |
| -- Option as Alt (matching Ghostty macos-option-as-alt = true) | |
| config.send_composed_key_when_left_alt_is_pressed = false | |
| config.send_composed_key_when_right_alt_is_pressed = false | |
| -- Ghostty-style keybindings | |
| config.keys = { | |
| -- Cmd+K: Clear scrollback | |
| { | |
| key = "k", | |
| mods = "CMD", | |
| action = act.ClearScrollback("ScrollbackAndViewport"), | |
| }, | |
| -- Shift+Enter: Send literal newline | |
| { | |
| key = "Enter", | |
| mods = "SHIFT", | |
| action = act.SendString("\n"), | |
| }, | |
| -- Cmd+D: Split pane right (vertical split) | |
| { | |
| key = "d", | |
| mods = "CMD", | |
| action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }), | |
| }, | |
| -- Cmd+Shift+D: Split pane down (horizontal split) | |
| { | |
| key = "d", | |
| mods = "CMD|SHIFT", | |
| action = act.SplitVertical({ domain = "CurrentPaneDomain" }), | |
| }, | |
| -- Cmd+[: Navigate to previous pane | |
| { | |
| key = "[", | |
| mods = "CMD", | |
| action = act.ActivatePaneDirection("Prev"), | |
| }, | |
| -- Cmd+]: Navigate to next pane | |
| { | |
| key = "]", | |
| mods = "CMD", | |
| action = act.ActivatePaneDirection("Next"), | |
| }, | |
| -- Cmd+W: Close current pane (or tab if last pane) | |
| { | |
| key = "w", | |
| mods = "CMD", | |
| action = act.CloseCurrentPane({ confirm = true }), | |
| }, | |
| -- Cmd+Option+Arrow: Navigate panes by direction | |
| { | |
| key = "LeftArrow", | |
| mods = "CMD|OPT", | |
| action = act.ActivatePaneDirection("Left"), | |
| }, | |
| { | |
| key = "RightArrow", | |
| mods = "CMD|OPT", | |
| action = act.ActivatePaneDirection("Right"), | |
| }, | |
| { | |
| key = "UpArrow", | |
| mods = "CMD|OPT", | |
| action = act.ActivatePaneDirection("Up"), | |
| }, | |
| { | |
| key = "DownArrow", | |
| mods = "CMD|OPT", | |
| action = act.ActivatePaneDirection("Down"), | |
| }, | |
| } | |
| return config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment