feat: add <C-w>f to open a hinted link in a split view
Assisted-by: Claude Opus 4.6 via pi
change ytrwwluonrpwkyklntzzntplznwrwnml
commit 7b53c493eb410d90f70b3ed0fcfbadcf808b3c33
author Alpha Chen <alpha@kejadlen.dev>
date
parent owskmnwz
diff --git a/.config/glide/unstable.glide.ts b/.config/glide/unstable.glide.ts
index df570720..b4f3f62e 100644
--- a/.config/glide/unstable.glide.ts
+++ b/.config/glide/unstable.glide.ts
@@ -90,6 +90,29 @@ glide.keymaps.set(
   { description: "Previous tab (skipping split siblings)" },
 );
 
+glide.keymaps.set(
+  "normal",
+  "<C-w>f",
+  async ({ tab_id }) => {
+    await glide.hints.show({
+      action: async ({ content }) => {
+        const href = await content.execute((target) => {
+          const anchor = target.closest("a");
+          return anchor?.href ?? null;
+        });
+        if (!href) return;
+        const new_tab = await browser.tabs.create({ url: href, active: false });
+        if (new_tab.id) {
+          glide.unstable.split_views.create([tab_id, new_tab.id]);
+        }
+      },
+    });
+  },
+  {
+    description: "Follow a hint in a split view",
+  },
+);
+
 glide.keymaps.set(
   "normal",
   "<C-w>q",