summaryrefslogtreecommitdiff
path: root/fnl/util.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/util.fnl')
-rw-r--r--fnl/util.fnl12
1 files changed, 12 insertions, 0 deletions
diff --git a/fnl/util.fnl b/fnl/util.fnl
new file mode 100644
index 0000000..8bb3754
--- /dev/null
+++ b/fnl/util.fnl
@@ -0,0 +1,12 @@
+;; Utility functions.
+(module util {autoload {nvim aniseed.nvim}})
+
+(def- path (.. (vim.fn.stdpath :data) :/site/pack/packer/start))
+(def num-plugins (length (vim.fn.readdir path)))
+
+(defn load-plugin [name]
+ (let [(ok? val-or-err) (pcall require name)]
+ (if ok?
+ val-or-err
+ (vim.notify (.. "Could not load config: " val-or-err)
+ vim.log.levels.WARN))))