From 31cab8c4624770df1d3ed7c7f7980bc1d6bed8d0 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 8 Jan 2023 20:22:49 +0100 Subject: Refactor loading of plugins --- fnl/config/init.fnl | 10 +++------- fnl/config/lsp/init.fnl | 6 ++++++ fnl/config/util.fnl | 6 ++++++ 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 fnl/config/lsp/init.fnl diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index b8bbddf..b4bfff5 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -16,9 +16,7 @@ :config.harpoon :config.leap :config.lir - :config.lsp.lspconfig - :config.lsp.mason - :config.lsp.null-ls + :config.lsp :config.lualine :config.minibar :config.neogit @@ -40,7 +38,5 @@ :config.window-picker :config.zen]) -(let [configs []] - (each [_ plugin (pairs plugins)] - (table.insert configs (require plugin))) - configs) +(let [util (require :config.util)] + (util.load plugins)) diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl new file mode 100644 index 0000000..6166fa1 --- /dev/null +++ b/fnl/config/lsp/init.fnl @@ -0,0 +1,6 @@ +;; Lsp modules. + +(local plugins [:config.lsp.lspconfig :config.lsp.mason :config.lsp.null-ls]) + +(let [util (require :config.util)] + (util.load plugins)) diff --git a/fnl/config/util.fnl b/fnl/config/util.fnl index dbd635f..e2800a6 100644 --- a/fnl/config/util.fnl +++ b/fnl/config/util.fnl @@ -12,3 +12,9 @@ themes (require :telescope.themes) theme (. opts :theme)] ((. telescope builtin) ((. themes theme) opts)))) + +(defn load [plugins] + (let [configs []] + (each [_ plugin (pairs plugins)] + (table.insert configs (require plugin))) + configs)) -- cgit v1.2.3-70-g09d2