summaryrefslogtreecommitdiff
path: root/fnl/util/load.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/util/load.fnl')
-rw-r--r--fnl/util/load.fnl8
1 files changed, 8 insertions, 0 deletions
diff --git a/fnl/util/load.fnl b/fnl/util/load.fnl
new file mode 100644
index 0000000..fef9b6e
--- /dev/null
+++ b/fnl/util/load.fnl
@@ -0,0 +1,8 @@
+;; Load file with function
+
+(λ load-and-apply [path f]
+ (each [fname type (vim.fs.dir (.. (vim.fn.stdpath :config) path))]
+ (when (= type :file)
+ (f (fname:match "^(.*)%.fnl$")))))
+
+{: load-and-apply}