aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glide/.config/glide/glide.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/glide/.config/glide/glide.ts b/glide/.config/glide/glide.ts
index 48430db..b7dfa61 100644
--- a/glide/.config/glide/glide.ts
+++ b/glide/.config/glide/glide.ts
@@ -436,3 +436,18 @@ glide.autocmds.create("UrlEnter", {
'geo.provider.network.url',
'data:application/json,{"location": {"lat": 45.542805, "lng": -122.7369563}, "accuracy": 100.0}');
});
+
+glide.autocmds.create("UrlEnter", /git(\.sr\.ht|hub\.com)\/.*?\/commit\//, async () => {
+ glide.buf.keymaps.set(
+ "normal",
+ "yc",
+ () => {
+ const parts = glide.ctx.url.pathname.split('/');
+
+ if (parts[parts.length - 2] === 'commit') {
+ navigator.clipboard.writeText(parts[parts.length - 1]);
+ } else {
+ console.error('no deal', parts[parts.length - 2]);
+ }
+ });
+});