summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-01-05 14:21:05 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-01-05 14:21:05 +0100
commitba5400946e9ee19dce851e91a36bb1670d265233 (patch)
treed0b80efd53111ee097bb52763097be22adfb04cf /fnl
parentfdff316fff423dd37a093ce1fff1ab289533305c (diff)
Fix loading of plugins
Diffstat (limited to 'fnl')
-rw-r--r--fnl/aktersnurra.fnl7
-rw-r--r--fnl/plugins/init.fnl10
-rw-r--r--fnl/plugins/lsp/init.fnl2
-rw-r--r--fnl/plugins/treesitter.fnl2
4 files changed, 16 insertions, 5 deletions
diff --git a/fnl/aktersnurra.fnl b/fnl/aktersnurra.fnl
index df07743..f9c7ca2 100644
--- a/fnl/aktersnurra.fnl
+++ b/fnl/aktersnurra.fnl
@@ -34,8 +34,7 @@
(.. (. icons :star) " ")
(.. (. icons :line) " ")]}}})
-(let [lazy (require :lazy)]
+(let [lazy (require :lazy)
+ plugins (require :plugins)]
(vim.keymap.set :n :<leader>y "<cmd>Lazy home<cr>" {:desc :Home})
- (lazy.setup {:spec [{:import :plugins}
- {:import :plugins.lsp.lspconfig}
- {:import :plugins.lsp.mason}]} opts))
+ (lazy.setup plugins opts))
diff --git a/fnl/plugins/init.fnl b/fnl/plugins/init.fnl
new file mode 100644
index 0000000..470776e
--- /dev/null
+++ b/fnl/plugins/init.fnl
@@ -0,0 +1,10 @@
+;; Load all plugins.
+
+(let [plugins []
+ path (.. (vim.fn.stdpath :config) :/fnl/plugins)]
+ (each [fname (vim.fs.dir path)]
+ (let [fname (fname:match "^(.*)%.fnl$")]
+ (if (and (not= fname nil) (not= fname :init))
+ (table.insert plugins (require (.. :plugins. fname))))))
+ (table.insert plugins (require :plugins.lsp))
+ plugins)
diff --git a/fnl/plugins/lsp/init.fnl b/fnl/plugins/lsp/init.fnl
index c06a5aa..f04ba86 100644
--- a/fnl/plugins/lsp/init.fnl
+++ b/fnl/plugins/lsp/init.fnl
@@ -1 +1,3 @@
;; Lsp plugins.
+
+[(require :plugins.lsp.lspconfig) (require :plugins.lsp.mason)]
diff --git a/fnl/plugins/treesitter.fnl b/fnl/plugins/treesitter.fnl
index 103948d..c863f03 100644
--- a/fnl/plugins/treesitter.fnl
+++ b/fnl/plugins/treesitter.fnl
@@ -80,5 +80,5 @@
{1 :nvim-treesitter/nvim-treesitter
:dependencies [{1 :nvim-treesitter/nvim-treesitter-textobjects :lazy true}]
:build ":TSUpdate"
- :event [:BufReadPost :BufNewFile]
+ :event [:VeryLazy]
: config}