From: Michael D. Lowis Date: Fri, 28 Jul 2017 13:01:34 +0000 (-0400) Subject: Added work-specific rule to tfetch for finding and opening source files X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ba5a3a3b5403ec9d64f2ac05bcf7648ce07d66b3;p=projs%2Ftide.git Added work-specific rule to tfetch for finding and opening source files --- diff --git a/tfetch.c b/tfetch.c index 22b53b2..fe58a72 100644 --- 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)://.*" },