Repository navigation
Expand file tree
/
Copy pathwezterm.lua
More file actions
executable file
·66 lines (58 loc) · 1.96 KB
/
Copy pathwezterm.lua
File metadata and controls
executable file
·66 lines (58 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
WEZTERM = require("wezterm")
ACTION = WEZTERM.action
OPACITY_EVENT = "toggle-opacity"
WEZTERM.on(OPACITY_EVENT, function(window, pane)
local overrides = window:get_config_overrides() or {}
if overrides.window_background_opacity == 0 then
overrides.window_background_opacity = nil
else
overrides.window_background_opacity = (overrides.window_background_opacity or 1) - 0.25
end
window:set_config_overrides(overrides)
end)
WEZTERM.on("gui-startup", function(cmd)
local _, _, window = WEZTERM.mux.spawn_window(cmd or {})
window:gui_window():maximize()
end)
local function getDefaultConfig()
return WEZTERM.config_builder()
end
local function disableUnwantedFeatures(config)
config.hide_tab_bar_if_only_one_tab = true
config.window_close_confirmation = "NeverPrompt"
config.window_padding = { top = 0, bottom = 0, left = 0, right = 0 }
config.enable_scroll_bar = false
config.harfbuzz_features = { "calt=0", "clig=0", "liga=0" }
return config
end
local function bindKeys(config)
config.keys = {
{ key = "F11", action = ACTION.ToggleFullScreen },
{ key = "c", mods = "CTRL|SHIFT", action = ACTION.CopyTo("Clipboard") },
{ key = "v", mods = "CTRL|SHIFT", action = ACTION.PasteFrom("Clipboard") },
{ key = "p", mods = "CTRL|SHIFT", action = ACTION.ActivateCommandPalette },
{ key = "o", mods = "CTRL|SHIFT", action = ACTION.EmitEvent(OPACITY_EVENT) },
{
key = "k",
mods = "ALT",
action = WEZTERM.action_callback(function(window, pane)
pane:send_text("pd_day.sh")
end),
},
}
return config
end
local function configureDisplay(config)
config.font_size = 14
return config
end
local function configureIfWindows(config)
local function isWindows()
return string.find(WEZTERM.target_triple, "windows")
end
if isWindows() then
config.default_prog = { "wsl.exe", "~" }
end
return config
end
return configureIfWindows(configureDisplay(bindKeys(disableUnwantedFeatures(getDefaultConfig()))))