summaryrefslogtreecommitdiff
path: root/fnl/config/util.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/config/util.fnl')
-rw-r--r--fnl/config/util.fnl13
1 files changed, 13 insertions, 0 deletions
diff --git a/fnl/config/util.fnl b/fnl/config/util.fnl
new file mode 100644
index 0000000..a4dcf5b
--- /dev/null
+++ b/fnl/config/util.fnl
@@ -0,0 +1,13 @@
+;; Utility functions.
+(module util {autoload {a aniseed.core nvim aniseed.nvim}})
+
+(defn prequire [name]
+ (let [(ok? plugin) (pcall require name)]
+ (if ok?
+ plugin
+ (vim.notify (.. "Could not load config: " plugin)
+ vim.log.levels.WARN))))
+
+(defn setup [plugin config]
+ (let [plugin (prequire plugin)]
+ (plugin.setup config)))