Last active
January 5, 2026 03:18
-
-
Save shunia/bd1152054637d5b69ba73631df66aeee to your computer and use it in GitHub Desktop.
WezTerm config
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
| -- Pull in the wezterm API | |
| local wezterm = require 'wezterm' | |
| local act = wezterm.action | |
| -- This will hold the configuration. | |
| local config = wezterm.config_builder() | |
| -- default theme | |
| config.color_scheme = 'Vs Code Dark+ (Gogh)' | |
| -- scroll back configurations | |
| config.scrollback_lines = 1000 | |
| config.enable_scroll_bar = true | |
| -- custom key bindings | |
| config.keys = { | |
| -- show launcher menu | |
| { key = 'l', mods = 'CTRL', action = act.ShowLauncher }, | |
| -- spawn a new tab with the current domain | |
| { key = 't', mods = 'CTRL', action = act.SpawnTab 'CurrentPaneDomain' }, | |
| -- This will create a new split and run your default program inside it | |
| { key = 'w', mods = 'CTRL|SHIFT', action = act.SplitPane { direction = 'Up' } }, | |
| { key = 's', mods = 'CTRL|SHIFT', action = act.SplitPane { direction = 'Down' } }, | |
| { key = 'a', mods = 'CTRL|SHIFT', action = act.SplitPane { direction = 'Left' } }, | |
| { key = 'd', mods = 'CTRL|SHIFT', action = act.SplitPane { direction = 'Right' } }, | |
| -- close current pane | |
| { key = 'w', mods = 'CTRL', action = act.CloseCurrentPane { confirm = true } }, | |
| } | |
| -- activate tab key with ALT + n | |
| for i = 1, 8 do | |
| table.insert(config.keys, { | |
| key = tostring(i), | |
| mods = 'ALT', | |
| action = act.ActivateTab(i - 1), | |
| }) | |
| end | |
| -- right click copy & paste | |
| config.mouse_bindings = { | |
| { | |
| event = { Down = { streak = 1, button = "Right" } }, | |
| mods = "NONE", | |
| action = wezterm.action_callback(function(window, pane) | |
| local has_selection = window:get_selection_text_for_pane(pane) ~= "" | |
| if has_selection then | |
| window:perform_action(act.CopyTo("ClipboardAndPrimarySelection"), pane) | |
| window:perform_action(act.ClearSelection, pane) | |
| else | |
| window:perform_action(act({ PasteFrom = "Clipboard" }), pane) | |
| end | |
| end), | |
| }, | |
| } | |
| -- powershell 7 support for windows | |
| if wezterm.target_triple == 'x86_64-pc-windows-msvc' then | |
| config.launch_menu = {} | |
| table.insert(config.launch_menu, { | |
| label = "PowerShell", | |
| args = { "pwsh.exe", "-NoLogo" }, | |
| }) | |
| config.default_prog = { "pwsh.exe", "-NoLogo" } | |
| end | |
| -- Finally, return the configuration to wezterm: | |
| return config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment