Skip to content

Instantly share code, notes, and snippets.

@AB9IL
Last active June 13, 2023 15:31
Show Gist options
  • Save AB9IL/60a3ab046f787f3b04e169054aa41238 to your computer and use it in GitHub Desktop.
Save AB9IL/60a3ab046f787f3b04e169054aa41238 to your computer and use it in GitHub Desktop.
Wezterm Configuration-Tmux-keybinds
-- Wezterm with Tmux keybinds
-- https://gist.github.com/AB9IL/60a3ab046f787f3b04e169054aa41238
-- Pull in the wezterm API
local wezterm = require 'wezterm';
return {
default_prog = default_prog,
hide_tab_bar_if_only_one_tab = true,
-- Do not hold on exit by default.
-- Because the default 'CloseOnCleanExit' can be annoying when exiting with
-- Ctrl-D and the last command exited with non-zero: the shell will exit
-- with non-zero and the terminal would hang until the window is closed manually.
exit_behavior = 'Close',
term = 'xterm-256color',
color_scheme = 'Pro',
window_frame = {
font = wezterm.font { family = 'Noto Sans', weight = 400 },
},
window_decorations = 'NONE',
-- Pad the window content:
window_padding = {
left = 3, right = 3,
top = 3, bottom = 3,
},
window_background_opacity = 0.7,
inactive_pane_hsb = {
saturation = 0.9,
brightness = 0.7,
},
-- Don't use dead keys
use_dead_keys = false,
-- How many lines of scrollback you want to retain per tab
scrollback_lines = 3500,
font = wezterm.font_with_fallback {
{ family = 'BitstreamVeraSansMono', weight = 400 },
{ family = 'Symbols Nerd Font' },
},
font_size = 10.0,
line_height = 1.1,
leader = { key='a', mods='CTRL' },
hide_tab_bar_if_only_one_tab = true,
keys = {
{ key = 'a', mods = 'LEADER|CTRL', action=wezterm.action{SendString='\x01'}},
{ key = '-', mods = 'LEADER', action=wezterm.action{SplitVertical={domain='CurrentPaneDomain'}}},
{ key = '\\',mods = 'LEADER', action=wezterm.action{SplitHorizontal={domain='CurrentPaneDomain'}}},
{ key = 's', mods = 'LEADER', action=wezterm.action{SplitVertical={domain='CurrentPaneDomain'}}},
{ key = 'v', mods = 'LEADER', action=wezterm.action{SplitHorizontal={domain='CurrentPaneDomain'}}},
{ key = 'o', mods = 'LEADER', action='TogglePaneZoomState' },
{ key = 'z', mods = 'LEADER', action='TogglePaneZoomState' },
{ key = 'c', mods = 'LEADER', action=wezterm.action{SpawnTab='CurrentPaneDomain'}},
{ key = 'h', mods = 'LEADER', action=wezterm.action{ActivatePaneDirection='Left'}},
{ key = 'j', mods = 'LEADER', action=wezterm.action{ActivatePaneDirection='Down'}},
{ key = 'k', mods = 'LEADER', action=wezterm.action{ActivatePaneDirection='Up'}},
{ key = 'l', mods = 'LEADER', action=wezterm.action{ActivatePaneDirection='Right'}},
{ key = 'H', mods = 'LEADER|SHIFT', action=wezterm.action{AdjustPaneSize={'Left', 5}}},
{ key = 'J', mods = 'LEADER|SHIFT', action=wezterm.action{AdjustPaneSize={'Down', 5}}},
{ key = 'K', mods = 'LEADER|SHIFT', action=wezterm.action{AdjustPaneSize={'Up', 5}}},
{ key = 'L', mods = 'LEADER|SHIFT', action=wezterm.action{AdjustPaneSize={'Right', 5}}},
{ key = '1', mods = 'LEADER', action=wezterm.action{ActivateTab=0}},
{ key = '2', mods = 'LEADER', action=wezterm.action{ActivateTab=1}},
{ key = '3', mods = 'LEADER', action=wezterm.action{ActivateTab=2}},
{ key = '4', mods = 'LEADER', action=wezterm.action{ActivateTab=3}},
{ key = '5', mods = 'LEADER', action=wezterm.action{ActivateTab=4}},
{ key = '6', mods = 'LEADER', action=wezterm.action{ActivateTab=5}},
{ key = '7', mods = 'LEADER', action=wezterm.action{ActivateTab=6}},
{ key = '8', mods = 'LEADER', action=wezterm.action{ActivateTab=7}},
{ key = '9', mods = 'LEADER', action=wezterm.action{ActivateTab=8}},
{ key = '&', mods = 'LEADER|SHIFT', action=wezterm.action{CloseCurrentTab={confirm=true}}},
{ key = 'd', mods = 'LEADER', action=wezterm.action{CloseCurrentPane={confirm=true}}},
{ key = 'x', mods = 'LEADER', action=wezterm.action{CloseCurrentPane={confirm=true}}},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment