]> git.mdlowis.com Git - projs/tide.git/commitdiff
added rule for man pages
authorMichael D. Lowis <mike@mdlowis.com>
Sun, 3 Nov 2019 03:24:25 +0000 (23:24 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sun, 3 Nov 2019 03:24:25 +0000 (23:24 -0400)
src/fetch.c

index bfa44925317b034cce36b63e6dc8219d47401de3..eb8ef02cc8d561be8583e7df5dcb2a9e8a0e4543 100644 (file)
@@ -59,6 +59,13 @@ static Rule*** BuiltinRules = (Rule**[]){
 //        &(Rule){ LAUNCH, "find Code -type f -name \"*$data\" | xargs -r edit", NULL },
 //        &(Rule){ COMPLETE, NULL, NULL }
 //    },
+
+    (Rule*[]){ /* Open man pages in a tide window */
+        &(Rule){ ISSET, "BROWSER", NULL },
+        &(Rule){ MATCHES, "data", "(.+)\\(([0-9]+)\\)" },
+        &(Rule){ LAUNCH, "man -Pcat $M2 \"$M1\" | tide -", NULL },
+        &(Rule){ COMPLETE, NULL, NULL }
+    },
     (Rule*[]){ /* If it's an existing directory, open it with system default */
         &(Rule){ ISDIR, "$data", NULL },
         &(Rule){ LAUNCH, "cd $data && ls -ap | tide -", NULL },