From a99b211b3bec43ebe3cdfa1899cba227d1d569a4 Mon Sep 17 00:00:00 2001 From: Ibrahim Muftee Date: Thu, 11 Apr 2024 23:20:57 -0500 Subject: Initial commit --- dot_config/wezterm/keys.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 dot_config/wezterm/keys.lua (limited to 'dot_config/wezterm/keys.lua') diff --git a/dot_config/wezterm/keys.lua b/dot_config/wezterm/keys.lua new file mode 100644 index 0000000..22889da --- /dev/null +++ b/dot_config/wezterm/keys.lua @@ -0,0 +1,36 @@ +local wezterm = require("wezterm") + +local M = { + leader = { key = "t", mods = "CTRL", timeout_milliseconds = 500 }, + key_bindings = { + -- Leader commands + -- Ctrl+t (for "terminal" is my leader key for Wezterm, and it's the gateway + -- into all my most-used terminal commands. + -- By avoiding the single keystroke Ctrl+t in my Vim config, I can prevent + -- key conflicts between Vim and Wezterm. + + -- Pane splitting + { key = "s", mods = "LEADER|CTRL", action = wezterm.action.SplitHorizontal }, + { key = "v", mods = "LEADER|CTRL|SHIFT", action = wezterm.action.SplitVertical }, + + -- Clipboard actions + { key = "v", mods = "LEADER|CTRL", action = wezterm.action.PasteFrom("Clipboard") }, + { key = "x", mods = "LEADER|CTRL", action = wezterm.action.ActivateCopyMode }, + + -- Fallback - use Ctrl-T, Ctrl-Shift-T to send a literal "Ctrl-T" to the console + { key = "t", mods = "LEADER|CTRL|SHIFT", action = wezterm.action.SendKey({ key = "t", mods = "CTRL" }) }, + + -- Ctrl+h/j/k/l is for Vim, so use C+A+h/j/k/l to move between + -- panes in the terminal + { key = "h", mods = "CTRL|ALT", action = { ActivatePaneDirection = "Left" } }, + { key = "j", mods = "CTRL|ALT", action = { ActivatePaneDirection = "Down" } }, + { key = "k", mods = "CTRL|ALT", action = { ActivatePaneDirection = "Up" } }, + { key = "l", mods = "CTRL|ALT", action = { ActivatePaneDirection = "Right" } }, + + -- Reload config + { key = "r", mods = "LEADER|CTRL|SHIFT", action = wezterm.action.ReloadConfiguration }, + + }, +} + +return M -- cgit v1.2.3