Skip to content

Commit

Permalink
added resize shortcuts to wezterm
Browse files Browse the repository at this point in the history
  • Loading branch information
yerlaser committed Sep 23, 2023
1 parent 1b1c028 commit 9a21f76
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions configs/wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,38 @@ return {
unzoom_on_switch_pane = true,
leader = { key = "q", mods = "SUPER", timeout_milliseconds = 3000 },
keys = {
{ key = "q" , mods = "SUPER" , action = wezterm.action.DisableDefaultAssignment },
{ key = "w" , mods = "SUPER" , action = wezterm.action.DisableDefaultAssignment },
{ key = "w" , mods = "SUPER" , action = wezterm.action.ActivatePaneDirection "Next" },
{ key = "x" , mods = "SUPER" , action = wezterm.action.ActivateCopyMode },
{ key = "d" , mods = "LEADER" , action = wezterm.action.SplitPane { direction = "Down" } },
{ key = "r" , mods = "LEADER" , action = wezterm.action.SplitPane { direction = "Right" } },
{ 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 = "f" , mods = "LEADER" , action = wezterm.action.TogglePaneZoomState },
{ key = "q" , mods = "LEADER" , action = wezterm.action.CloseCurrentTab { confirm = true } },
{ key = "w" , mods = "LEADER" , action = wezterm.action.CloseCurrentPane { confirm = true } },
{ key = "Backspace" , mods = "ALT" , action = wezterm.action.SendString("\x1B[D") }, -- Left
{ key = "Backspace" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[1;2H") }, -- Shift-Home
{ key = "Backspace" , mods = "SHIFT" , action = wezterm.action.SendString("\x1B\x7F") }, -- Alt-Backspace
{ key = "Backspace" , mods = "CTRL" , action = wezterm.action.SendString("\x1B\x7F") }, -- Alt-Backspace
{ key = "Return" , mods = "ALT" , action = wezterm.action.SendString("\x1B[C") }, -- Right
{ key = "Return" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[1;2F") }, -- Shift-End
{ key = "Return" , mods = "SHIFT" , action = wezterm.action.SendString("\x1B") }, -- Escape
{ key = "Return" , mods = "CTRL" , action = wezterm.action.SendString("\x1B-\x1Bu") }, -- Alt-- Alt-u
{ key = "Return" , mods = "CTRL|SHIFT" , action = wezterm.action.SendString("\x1B-\x1Bl") }, -- Alt-- Alt-l
{ key = "Space" , mods = "ALT" , action = wezterm.action.SendString("\x1B[A") }, -- Up
{ key = "Space" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[5;2~") }, -- Shift-PageUp
{ key = "Space" , mods = "CTRL|SHIFT" , action = wezterm.action.SendString("\x0F") }, -- Ctrl-o
{ key = "Tab" , mods = "ALT" , action = wezterm.action.SendString("\x1B[B") }, -- Down
{ key = "Tab" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[6;2~") }, -- Shift-PageDown
{ key = "UpArrow" , mods = "CMD" , action = wezterm.action_callback(
{ key = "q" , mods = "SUPER" , action = wezterm.action.DisableDefaultAssignment },
{ key = "w" , mods = "SUPER" , action = wezterm.action.DisableDefaultAssignment },
{ key = "w" , mods = "SUPER" , action = wezterm.action.ActivatePaneDirection "Next" },
{ key = "x" , mods = "SUPER" , action = wezterm.action.ActivateCopyMode },
{ key = "d" , mods = "LEADER" , action = wezterm.action.SplitPane { direction = "Down" } },
{ key = "r" , mods = "LEADER" , action = wezterm.action.SplitPane { direction = "Right" } },
{ 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 = "f" , mods = "LEADER" , action = wezterm.action.TogglePaneZoomState },
{ 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 = "q" , mods = "LEADER" , action = wezterm.action.CloseCurrentTab { confirm = true } },
{ key = "w" , mods = "LEADER" , action = wezterm.action.CloseCurrentPane { confirm = true } },
{ key = "Backspace" , mods = "ALT" , action = wezterm.action.SendString("\x1B[D") }, -- Left
{ key = "Backspace" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[1;2H") }, -- Shift-Home
{ key = "Backspace" , mods = "SHIFT" , action = wezterm.action.SendString("\x1B\x7F") }, -- Alt-Backspace
{ key = "Backspace" , mods = "CTRL" , action = wezterm.action.SendString("\x1B\x7F") }, -- Alt-Backspace
{ key = "Return" , mods = "ALT" , action = wezterm.action.SendString("\x1B[C") }, -- Right
{ key = "Return" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[1;2F") }, -- Shift-End
{ key = "Return" , mods = "SHIFT" , action = wezterm.action.SendString("\x1B") }, -- Escape
{ key = "Return" , mods = "CTRL" , action = wezterm.action.SendString("\x1B-\x1Bu") }, -- Alt-- Alt-u
{ key = "Return" , mods = "CTRL|SHIFT" , action = wezterm.action.SendString("\x1B-\x1Bl") }, -- Alt-- Alt-l
{ key = "Space" , mods = "ALT" , action = wezterm.action.SendString("\x1B[A") }, -- Up
{ key = "Space" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[5;2~") }, -- Shift-PageUp
{ key = "Space" , mods = "CTRL|SHIFT" , action = wezterm.action.SendString("\x0F") }, -- Ctrl-o
{ key = "Tab" , mods = "ALT" , action = wezterm.action.SendString("\x1B[B") }, -- Down
{ key = "Tab" , mods = "ALT|SHIFT" , action = wezterm.action.SendString("\x1B[6;2~") }, -- Shift-PageDown
{ key = "UpArrow" , mods = "CMD" , action = wezterm.action_callback(
function(win, pane)
win:maximize()
end
Expand Down

0 comments on commit 9a21f76

Please sign in to comment.