summaryrefslogtreecommitdiff
path: root/dot_config/wezterm
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/wezterm')
-rw-r--r--dot_config/wezterm/chezmoi.lua.tmpl14
-rw-r--r--dot_config/wezterm/keys.lua36
-rw-r--r--dot_config/wezterm/wezterm.lua28
3 files changed, 78 insertions, 0 deletions
diff --git a/dot_config/wezterm/chezmoi.lua.tmpl b/dot_config/wezterm/chezmoi.lua.tmpl
new file mode 100644
index 0000000..a2fc09e
--- /dev/null
+++ b/dot_config/wezterm/chezmoi.lua.tmpl
@@ -0,0 +1,14 @@
+-- chezmoi.lua
+--
+-- Contains Chezmoi-templated tweaks to Wezterm.
+-- {{/* This file supports Go's text/template language. */}}
+
+local M = {}
+
+{{ if eq .chezmoi.os "windows" -}}
+M.shell = "pwsh"
+{{ else }}
+M.shell = "bash"
+{{ end -}}
+
+return M
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
diff --git a/dot_config/wezterm/wezterm.lua b/dot_config/wezterm/wezterm.lua
new file mode 100644
index 0000000..bdfcfcb
--- /dev/null
+++ b/dot_config/wezterm/wezterm.lua
@@ -0,0 +1,28 @@
+local wezterm = require("wezterm")
+local keys = require("keys")
+local chezmoi = require("chezmoi")
+
+local font = wezterm.font_with_fallback({
+ { family = "Iosevka Nerd Font" },
+ { family = "JetBrains Mono" },
+})
+
+local font_size = 12
+
+local config = {
+ font = font,
+ font_size = font_size,
+ color_scheme = "Gruvbox dark, medium (base16)", -- TODO: Create custom color scheme in separate module (colors.lua)
+ window_background_opacity = 0.9,
+
+ use_fancy_tab_bar = false,
+ show_tabs_in_tab_bar = false,
+ show_new_tab_button_in_tab_bar = false,
+
+ default_prog = { chezmoi.shell }, -- TODO: Change default shell when OS changes
+
+ leader = keys.leader,
+ keys = keys.key_bindings,
+}
+
+return config