]> git.mdlowis.com Git - projs/tide.git/commitdiff
Added work-specific rule to tfetch for finding and opening source files
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 28 Jul 2017 13:01:34 +0000 (09:01 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 28 Jul 2017 13:01:34 +0000 (09:01 -0400)
tfetch.c

index 22b53b29bfa49cc4650de4704a1a83fc60d01f39..fe58a72f3ab9ae73ef312a03e039eee76652ec94 100644 (file)
--- a/tfetch.c
+++ b/tfetch.c
@@ -26,6 +26,14 @@ typedef struct {
 char* Matches[10];
 
 Rule* BuiltinRules[] = {
+    (Rule[]){ // Look up .c or .h files in Code/
+        { ISSET, "EDITOR", NULL },
+        { MATCHES, "data", "\\.[ch]$" },
+        { ISDIR, "Code", NULL },
+        { EXEC, "[[ $(find Code -type f -name '*$data') ]]", NULL },
+        { LAUNCH, "find Code -type f -name '*$data' | xargs -r $EDITOR", NULL },
+        { COMPLETE, NULL, NULL }
+    },
     (Rule[]){ // Match URLS and open them with the browser
         { ISSET, "BROWSER", NULL },
         { MATCHES, "data", "^(https?|ftp)://.*" },