From 1d0aead722c589abbd6476d890ee1f5f08ddd5f5 Mon Sep 17 00:00:00 2001 From: Jonathan Conesa <24526564+intrudir@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:06:52 -0500 Subject: [PATCH] add tmux-like keybindings to wezterm --- dotfiles/windows/.wezterm.lua | 49 ++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/dotfiles/windows/.wezterm.lua b/dotfiles/windows/.wezterm.lua index 46ee769..06bc16b 100644 --- a/dotfiles/windows/.wezterm.lua +++ b/dotfiles/windows/.wezterm.lua @@ -1,12 +1,49 @@ --- Pull in the wezterm API local wezterm = require 'wezterm' --- This will hold the configuration. local config = wezterm.config_builder() --- For example, changing the color scheme: config.default_prog = { "powershell.exe", "-NoLogo" } -config.color_scheme = 'Argonaut' -config.font = wezterm.font 'FiraCode Nerd Font' --- and finally, return the configuration to wezterm + +-- config.color_scheme = 'Ayu Mirage (Gogh)' +config.color_scheme = 'Andromeda' + +config.font = wezterm.font('FiraCode Nerd Font') +config.font_size = 10.0 + +-- dpi = 192.0 + +-- add tmux-like keybindings +config.leader = { key="a", mods="CTRL" } +config.hide_tab_bar_if_only_one_tab = true +config.keys = { + { key = "a", mods = "LEADER|CTRL", action=wezterm.action{SendString="\x01"}}, + { key = "\"", mods = "LEADER|SHIFT", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}}, + { key = "%",mods = "LEADER|SHIFT", 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}}}, +} + return config