X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/5c84235cdab6e69ddc4f54deef97dbac6e6b78c2..172a0e3a1dfb30a5587cdb28d89171fbe27e3fda:/wezterm/wezterm.lua?ds=inline diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua index ba4fc68..a3483a6 100644 --- a/wezterm/wezterm.lua +++ b/wezterm/wezterm.lua @@ -25,14 +25,33 @@ 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) + wezterm.open_with(url, "rifle") end), }, }, + { + key = 'Enter', + mods = 'ALT', + action = wezterm.action.DisableDefaultAssignment, + }, } return config