From 0a054824fb411d6aed0a58cf7da87c59b864394e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 19 Jul 2022 18:35:13 +0200 Subject: Refactor plugins from module to table --- fnl/util.fnl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'fnl/util.fnl') diff --git a/fnl/util.fnl b/fnl/util.fnl index 47f9d10..0e90396 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -1,20 +1,19 @@ ;; Utility functions. -(module util {autoload {a aniseed.core - nvim aniseed.nvim - : packer - : plugins}}) +(module util {autoload {a aniseed.core nvim aniseed.nvim : packer}}) + +(def- plugins (require :plugins)) (def- path (.. (vim.fn.stdpath :data) :/site/pack/packer/start)) (defn- num-plugins [] (var i 0) - (each [_ _ (pairs plugins.plugins)] + (each [_ _ (pairs plugins)] (set i (+ i 1))) i) (defn- num-installed-plugins [] (length (vim.fn.readdir path))) (defn- install [] (packer.startup (fn [use] - (each [plugin opts (pairs plugins.plugins)] + (each [plugin opts (pairs plugins)] (use (a.assoc opts 1 plugin)))))) (defn load-plugins [] (install) -- cgit v1.2.3-70-g09d2