diff options
-rw-r--r-- | fnl/init.fnl | 9 | ||||
-rw-r--r-- | fnl/install.fnl | 18 | ||||
-rw-r--r-- | fnl/util.fnl | 15 |
3 files changed, 19 insertions, 23 deletions
diff --git a/fnl/init.fnl b/fnl/init.fnl index 498a030..2255db4 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -1,8 +1,9 @@ ;; Install, load settings, and load plugin configs. (module init - {autoload {util util}}) + {autoload {util util} + require [settings + config.packer]}) -(require :settings) -(require :config.packer) -(require :install) +(util.install) +(util.sync) (util.load-config) diff --git a/fnl/install.fnl b/fnl/install.fnl deleted file mode 100644 index 6f37ae8..0000000 --- a/fnl/install.fnl +++ /dev/null @@ -1,18 +0,0 @@ -;; Installs plugins with packer. -(module install - {autoload {a aniseed.core - packer packer - plugins plugins - util util}}) - -(defn- sync [] - (if (= util.num-plugins 3) - (packer.sync))) - -(defn- install [] - (packer.startup (fn [use] - (each [plugin opts (pairs plugins.plugins)] - (use (a.assoc opts 1 plugin)))))) - -(install) -(sync) diff --git a/fnl/util.fnl b/fnl/util.fnl index 7222ebb..c624f64 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -1,10 +1,23 @@ ;; Utility functions. -(module util {autoload {nvim aniseed.nvim}}) +(module util + {autoload {a aniseed.core + nvim aniseed.nvim + packer packer + plugins plugins}}) (def- path (.. (vim.fn.stdpath :data) :/site/pack/packer/start)) (def num-plugins (length (vim.fn.readdir path))) +(defn sync [] + (if (= num-plugins 3) + (packer.sync))) + +(defn install [] + (packer.startup (fn [use] + (each [plugin opts (pairs plugins.plugins)] + (use (a.assoc opts 1 plugin)))))) + (defn load-config [] (if (> num-plugins 3) (require :config))) |