Skip to content

Commit d169536

Browse files
committed
home/wezterm: quick select urls
1 parent 867f214 commit d169536

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

home/dot_config/wezterm/wezterm.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,18 @@ config.keys = {
242242
action = wezterm.action.QuickSelectArgs {
243243
label = 'open url',
244244
patterns = {
245-
'https?://\\S+',
245+
-- URLs in parens: (URL)
246+
'\\((\\w+://[^\\s\\)]+)(?:\\s+[^\\)]*)?\\)',
247+
-- URLs in brackets: [URL]
248+
'\\[(\\w+://\\S+?)\\]',
249+
-- URLs in curly braces: {URL}
250+
'\\{(\\w+://\\S+?)\\}',
251+
-- URLs in angle brackets: <URL>
252+
'<(\\w+://\\S+?)>',
253+
-- URLs not wrapped in brackets
254+
'(?<![\\(\\{\\[<])\\b\\w+://\\S+',
255+
-- Email addresses
256+
'\\b\\w+@[\\w-]+(\\.[\\w-]+)+\\b',
246257
},
247258
action = wezterm.action_callback(function(window, pane)
248259
local url = window:get_selection_text_for_pane(pane)

0 commit comments

Comments
 (0)