-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwezterm.lua
More file actions
183 lines (159 loc) · 4.51 KB
/
wezterm.lua
File metadata and controls
183 lines (159 loc) · 4.51 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
local function file_exists(path)
local f = io.open(path, "r")
if f~=nil then io.close(f) return true else return false end
end
if wezterm.target_triple == "x86_64-pc-windows-msvc" then
config.wsl_domains = {{
name = 'WSL:Ubuntu',
distribution = 'Ubuntu'
}}
config.default_domain = 'WSL:Ubuntu'
config.default_prog = {'C:/Program Files/PowerShell/7/pwsh.exe'}
if file_exists("C:/msys64/msys2_shell.cmd") then
local launch_msys2 = {
label = "MSYS2",
args = {"C:/msys64/msys2_shell.cmd",
"-defterm",
"-no-start",
"-use-full-path",
"-msys",
"-shell",
"zsh"},
cwd = "C:/msys64/home/" .. os.getenv('USERNAME'),
domain = {DomainName="local"},
}
config.launch_menu = {
launch_msys2,
}
end
end
config.mouse_bindings = { -- Right-Click paste
{
event = {
Down = {
streak = 1,
button = "Right"
}
},
mods = "NONE",
action = wezterm.action {
PasteFrom = "Clipboard"
}
}, -- CTRL-Left Click open hyperlinks
{
event = {
Up = {
streak = 1,
button = "Left"
}
},
mods = "CTRL",
action = "OpenLinkAtMouseCursor"
}, -- Left-Click select instant copy
{
event = {
Up = {
streak = 1,
button = 'Left'
}
},
mods = 'NONE',
action = wezterm.action.CompleteSelectionOrOpenLinkAtMouseCursor 'Clipboard'
}}
-- Scroll to prev / next prompt entry
config.keys = {{
key = 'UpArrow',
mods = 'SHIFT',
action = wezterm.action.ScrollToPrompt(-1)
}, {
key = 'DownArrow',
mods = 'SHIFT',
action = wezterm.action.ScrollToPrompt(1)
}}
wezterm.on("update-right-status", function(window)
local cal = wezterm.nerdfonts.cod_calendar
local clock = wezterm.nerdfonts.md_clock_outline
local date = wezterm.strftime(cal .. " %d %h " .. clock .. " %H:%M:%S ")
window:set_right_status(wezterm.format({{
Text = date
}}))
end)
wezterm.on('format-tab-title', function(_, _, _, _, _)
local tab_icon = wezterm.nerdfonts.md_tab
return {{
Text = ' ' .. tab_icon .. ' '
}}
end)
wezterm.on('window-resized', function(window, pane)
local w_width = window:get_dimensions().pixel_width
local w_height = window:get_dimensions().pixel_height
local w_is_fs = window:get_dimensions().is_full_screen
local s_width = wezterm.gui.screens().active.width
local s_height = wezterm.gui.screens().active.height
if not w_is_fs then
if w_height == s_height and w_width == s_width then -- assume maximize
title_button_state({
maximized = true
})
else
title_button_state({
maximized = false
})
end
else
title_button_state({
fullscreen = true
})
end
end)
function title_button_state(state)
if state then
local is_fullscreen = state.fullscreen
local is_maximized = state.maximized
else
local is_fullscreen = false
local is_maximized = false
end
config.integrated_title_buttons = {'Hide','Maximize','Close'}
local nf = wezterm.nerdfonts
local window_min = ' ' .. nf.cod_chrome_minimize .. ' '
local window_max = ' ' .. nf.cod_chrome_maximize .. ' '
local window_close = ' ' .. nf.cod_close .. ' '
local new_tab = ' ' .. nf.md_plus .. ' '
local new_tab_hover = ' ' .. nf.md_tab_unselected .. ' '
config.tab_bar_style = {
new_tab = new_tab,
new_tab_hover = new_tab_hover,
window_hide = window_min,
window_hide_hover = window_min,
window_maximize = window_max,
window_maximize_hover = window_max,
window_close = window_close,
window_close_hover = window_close
}
end
title_button_state()
config.window_close_confirmation = "NeverPrompt"
config.use_fancy_tab_bar = false
config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"
config.harfbuzz_features = {"calt=0", "clig=0", "liga=0"}
config.check_for_updates = true
config.text_background_opacity = 0.97
config.window_background_opacity = 0.97
config.color_scheme = "Catppuccin Mocha"
config.colors = {
background = "#001218"
}
-- config.font = wezterm.font("JetBrains Mono", { weight = 'Light' })
config.font = wezterm.font("OcodoMonoDotZero Nerd Font", { weight = 'Light' })
config.font_size = 12
config.window_padding = {
left = "6px",
right = "6px",
top = "6px",
bottom = "6px"
}
config.scrollback_lines = 100000
return config