From ba5a3a3b5403ec9d64f2ac05bcf7648ce07d66b3 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Fri, 28 Jul 2017 09:01:34 -0400 Subject: [PATCH] Added work-specific rule to tfetch for finding and opening source files --- tfetch.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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)://.*" }, -- 2.49.0