]> git.rmz.io Git - dotfiles.git/commitdiff
wezterm: open urls with keys bind
authorSamir Benmendil <me@rmz.io>
Wed, 21 Feb 2024 01:15:42 +0000 (01:15 +0000)
committerSamir Benmendil <me@rmz.io>
Wed, 21 Feb 2024 01:26:42 +0000 (01:26 +0000)
wezterm/wezterm.lua

index a4627b1db1355b2fad42d912b159e0e615b395fc..ba4fc68076e0c200df68febe9c1c7fc896df27db 100644 (file)
@@ -17,4 +17,22 @@ config.tab_bar_at_bottom            = true
 
 config.quick_select_alphabet = "aoeuisnthd"
 
+config.keys = {
+  {
+    key = 'F',
+    mods = 'CTRL',
+    action = wezterm.action.QuickSelectArgs {
+      label = 'open url',
+      patterns = {
+        'https?://\\S+',
+      },
+      action = wezterm.action_callback(function (win, pane)
+        local url = win:get_selection_text_for_pane(pane)
+        wezterm.log_info('opening: ' .. url)
+        wezterm.open_with(url)
+      end),
+    },
+  },
+}
+
 return config