summaryrefslogtreecommitdiff
path: root/fnl/plugins/init.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/plugins/init.fnl')
-rw-r--r--fnl/plugins/init.fnl29
1 files changed, 17 insertions, 12 deletions
diff --git a/fnl/plugins/init.fnl b/fnl/plugins/init.fnl
index 6b0bde8..00be90b 100644
--- a/fnl/plugins/init.fnl
+++ b/fnl/plugins/init.fnl
@@ -1,16 +1,21 @@
;; Load all plugins.
-(local plugins (let [plugins (require :plugins.lsp)
- path (.. (vim.fn.stdpath :config) :/fnl/plugins)]
- (if (vim.loop.fs_stat path)
- (do
- (each [fname (vim.fs.dir path)]
- (let [fname (fname:match "^(.*)%.fnl$")]
- (if (and (not= fname nil) (not= fname :init)
- (not= fname :lazy))
- (table.insert plugins
- (require (.. :plugins. fname))))))))
- plugins))
+(fn get-plugins [...]
+ (let [plugins []
+ path (.. (vim.fn.stdpath :config) :/fnl/plugins)]
+ (each [_ m (ipairs [...])]
+ (let [module-path (.. path "/" m)]
+ (if (vim.loop.fs_stat module-path)
+ (do
+ (if (= :lsp m)
+ (table.insert plugins (require (.. :plugins. m)))
+ (each [fname (vim.fs.dir module-path)]
+ (let [fname (fname:match "^(.*)%.fnl$")]
+ (table.insert plugins
+ (require (.. :plugins. m "." fname))))))))))
+ (vim.tbl_flatten plugins)
+ plugins))
-(let [lazy (require :plugins.lazy)]
+(let [lazy (require :plugins.core.lazy)
+ plugins (get-plugins :compiler :editor :lsp :tools :ui)]
(lazy.setup plugins))