Skip to content

Instantly share code, notes, and snippets.

@jayv
Last active February 16, 2024 22:37
Show Gist options
  • Save jayv/82a4508182ca83c39447b08068b0cb9f to your computer and use it in GitHub Desktop.
Save jayv/82a4508182ca83c39447b08068b0cb9f to your computer and use it in GitHub Desktop.
wezterm byobu keybindings
-- Pull in the wezterm API
local wezterm = require("wezterm")
local act = wezterm.action
-- 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()
-- config.disable_default_key_bindings = true
config.scrollback_lines = 10000
config.font = wezterm.font("MesloLGSDZ Nerd Font")
config.font_size = 15.0
config.color_scheme = "ayu"
config.hide_tab_bar_if_only_one_tab = true
config.keys = {
{ key = "F", mods = "CTRL|SHIFT", action = act.Search("CurrentSelectionOrEmptyString") },
{ key = "n", mods = "CTRL", action = act.CopyMode("NextMatch") },
{ key = "N", mods = "CTRL", action = act.CopyMode("PriorMatch") },
{ key = "PageUp", mods = "SHIFT", action = act.ScrollByPage(-1) },
{ key = "PageDown", mods = "SHIFT", action = act.ScrollByPage(1) },
{ key = "C", mods = "CTRL", action = act.CopyTo("Clipboard") },
{ key = "C", mods = "SHIFT|CTRL", action = act.CopyTo("Clipboard") },
{ key = "V", mods = "CTRL", action = act.PasteFrom("Clipboard") },
{ key = "V", mods = "SHIFT|CTRL", action = act.PasteFrom("Clipboard") },
{ key = "Copy", mods = "NONE", action = act.CopyTo("Clipboard") },
{ key = "Paste", mods = "NONE", action = act.PasteFrom("Clipboard") },
{ key = "F2", mods = "SHIFT", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
{ key = "F2", mods = "CTRL", action = act.SplitVertical({ domain = "CurrentPaneDomain" }) },
{ key = "F2", mods = "CTRL|SHIFT", action = act.SpawnTab("CurrentPaneDomain") },
{ key = "T", mods = "CTRL|SHIFT", action = act.SpawnTab("CurrentPaneDomain") },
{ key = "F6", mods = "CTRL", action = act.CloseCurrentPane({ confirm = true }) },
{ key = "PageUp", mods = "CTRL", action = act.ActivateTabRelative(-1) },
{ key = "PageDown", mods = "CTRL", action = act.ActivateTabRelative(1) },
{ key = "LeftArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Left") },
{ key = "LeftArrow", mods = "SHIFT|ALT", action = act.AdjustPaneSize({ "Left", 5 }) },
{ key = "RightArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Right") },
{ key = "RightArrow", mods = "SHIFT|ALT", action = act.AdjustPaneSize({ "Right", 5 }) },
{ key = "UpArrow", mods = "SHIFT|ALT", action = act.AdjustPaneSize({ "Up", 5 }) },
{ key = "DownArrow", mods = "SHIFT|ALT", action = act.AdjustPaneSize({ "Down", 5 }) },
{ key = "UpArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Up") },
{ key = "DownArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Down") },
{ key = "+", mods = "SHIFT|CTRL", action = act.IncreaseFontSize },
{ key = "-", mods = "CTRL", action = act.DecreaseFontSize },
{ key = "=", mods = "CTRL", action = act.IncreaseFontSize },
{ key = "=", mods = "SHIFT|CTRL", action = act.IncreaseFontSize },
{ key = "0", mods = "CTRL", action = act.ResetFontSize },
{ key = "0", mods = "SHIFT|CTRL", action = act.ResetFontSize },
}
end
-- This is where you actually apply your config choices
-- For example, changing the color scheme:
-- config.color_scheme = "AdventureTime"
-- and 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