]> git.rmz.io Git - dotfiles.git/blob - wezterm/wezterm.lua
zsh: add `turg` function to get most urgent task
[dotfiles.git] / wezterm / wezterm.lua
1 ---@type WezTerm
2 local wezterm = require('wezterm')
3 ---@type _.wezterm.ConfigBuilder
4 local config = {}
5
6 -- color
7 config.color_scheme = 'nord'
8 -- font
9 config.font = wezterm.font('Fira Code')
10 config.font_size = 11
11 config.harfbuzz_features = { 'ss03' }
12
13 config.adjust_window_size_when_changing_font_size = false
14
15 config.hide_tab_bar_if_only_one_tab = true
16 config.tab_bar_at_bottom = true
17
18 config.quick_select_alphabet = "aoeuisnthd"
19
20 config.keys = {
21 {
22 key = 'F',
23 mods = 'CTRL',
24 action = wezterm.action.QuickSelectArgs {
25 label = 'open url',
26 patterns = {
27 'https?://\\S+',
28 'stm\\.[#!]\\d+',
29 },
30 action = wezterm.action_callback(function (win, pane)
31 local url = win:get_selection_text_for_pane(pane)
32 wezterm.log_info('selected: ' .. url)
33 local found, _, proj, type, num = string.find(url, "^(stm)%.([#!])(%d+)$")
34 wezterm.log_info('selected: ' .. url)
35 if found ~= nil then
36 if type == "#" then type = "issues"
37 elseif type == "!" then type = "merge_requests"
38 else return
39 end
40 if proj == "stm" then proj = "springfield"
41 else proj = proj
42 end
43 url = string.format("https://gitlab.com/fppnt/sgnss/%s/-/%s/%d", proj, type, num)
44 end
45 wezterm.log_info('opening: ' .. url)
46 wezterm.open_with(url, "rifle")
47 end),
48 },
49 },
50 {
51 key = 'Enter',
52 mods = 'ALT',
53 action = wezterm.action.DisableDefaultAssignment,
54 },
55 }
56
57 return config