summaryrefslogtreecommitdiff
path: root/dot_config/wezterm/keys.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/wezterm/keys.lua')
-rw-r--r--dot_config/wezterm/keys.lua36
1 files changed, 36 insertions, 0 deletions
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