summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author135e2 <[email protected]>2023-01-08 12:56:07 +0800
committer135e2 <[email protected]>2023-01-08 12:56:07 +0800
commitb05431ebf4121b660dfb3f60fb012fa7f16f6c1e (patch)
tree5ce7a887eb44f322353dddc19ae95e0c153a2d51
parent51a7c9f79c41f73d1cff8e6fbfaaaaabaea1836c (diff)
downloaddotfiles-b05431ebf4121b660dfb3f60fb012fa7f16f6c1e.tar.gz
dotfiles-b05431ebf4121b660dfb3f60fb012fa7f16f6c1e.tar.bz2
dotfiles-b05431ebf4121b660dfb3f60fb012fa7f16f6c1e.zip
config/wezterm: new, 20230108
-rw-r--r--config/wezterm/wezterm.lua70
1 files changed, 70 insertions, 0 deletions
diff --git a/config/wezterm/wezterm.lua b/config/wezterm/wezterm.lua
new file mode 100644
index 0000000..c39ba48
--- /dev/null
+++ b/config/wezterm/wezterm.lua
@@ -0,0 +1,70 @@
+local wezterm = require("wezterm")
+
+local config = {
+ check_for_updates = false,
+ color_scheme = "nordfox",
+ inactive_pane_hsb = {
+ hue = 1.0,
+ saturation = 1.0,
+ brightness = 1.0,
+ },
+ default_prog = { '/bin/zsh', '-l' },
+ font_size = 12.0,
+ launch_menu = {},
+ leader = { key="a", mods="CTRL" },
+ disable_default_key_bindings = true,
+ window_background_opacity = 0.9,
+ keys = {
+ -- Send "CTRL-A" to the terminal when pressing CTRL-A, CTRL-A
+ { key = "a", mods = "LEADER|CTRL", action=wezterm.action{SendString="\x01"}},
+ { key = "-", mods = "LEADER", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}},
+ { key = "\\",mods = "LEADER", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}},
+ { 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 = "x", mods = "LEADER", action=wezterm.action{CloseCurrentPane={confirm=true}}},
+
+ { key = "n", mods="SHIFT|CTRL", action="ToggleFullScreen" },
+ { key="v", mods="SHIFT|CTRL", action="Paste"},
+ { key="c", mods="SHIFT|CTRL", action="Copy"},
+ },
+ set_environment_variables = {},
+}
+
+if wezterm.target_triple == "x86_64-pc-windows-msvc" then
+ -- ? config.front_end = "Software" -- OpenGL doesn't work quite well with RDP.
+ config.default_prog = { "pwsh.exe" }
+ table.insert(config.launch_menu, { label = "PowerShell", args = {"powershell.exe", "-NoLogo"} })
+
+ -- Find installed visual studio version(s) and add their compilation
+ -- environment command prompts to the menu
+ for _, vsvers in ipairs(wezterm.glob("Microsoft Visual Studio/20*", "C:/Program Files (x86)")) do
+ local year = vsvers:gsub("Microsoft Visual Studio/", "")
+ table.insert(config.launch_menu, {
+ label = "x64 Native Tools VS " .. year,
+ args = {"cmd.exe", "/k", "C:/Program Files (x86)/" .. vsvers .. "/BuildTools/VC/Auxiliary/Build/vcvars64.bat"},
+ })
+ end
+else
+ table.insert(config.launch_menu, { label = "bash", args = {"bash", "-l"} })
+ table.insert(config.launch_menu, { label = "zsh", args = {"zsh", "-l"} })
+end
+
+return config