From 9fa49d6bf0ea6f2fc154f1733837aac2b887a100 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 7 Dec 2025 21:14:38 +0000 Subject: [PATCH] wezterm: follow 'stm.[#!]NNN' links to gitlab website --- wezterm/wezterm.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua index 2689c2c..a3483a6 100644 --- a/wezterm/wezterm.lua +++ b/wezterm/wezterm.lua @@ -25,9 +25,23 @@ config.keys = { label = 'open url', patterns = { 'https?://\\S+', + 'stm\\.[#!]\\d+', }, action = wezterm.action_callback(function (win, pane) local url = win:get_selection_text_for_pane(pane) + wezterm.log_info('selected: ' .. url) + local found, _, proj, type, num = string.find(url, "^(stm)%.([#!])(%d+)$") + wezterm.log_info('selected: ' .. url) + if found ~= nil then + if type == "#" then type = "issues" + elseif type == "!" then type = "merge_requests" + else return + end + if proj == "stm" then proj = "springfield" + else proj = proj + end + url = string.format("https://gitlab.com/fppnt/sgnss/%s/-/%s/%d", proj, type, num) + end wezterm.log_info('opening: ' .. url) wezterm.open_with(url, "rifle") end), -- 2.51.2